:root {
    /* Light Mode (Zadržavamo svelte boje za light mode, ali ubacujemo tvoje ljubičaste tonove kao glavne) */
    --bg-color: #f4f0f7;
    --text-color: #0C0516;
    --card-bg: #ffffff;
    --primary-color: #7F3AA1; 
    --primary-hover: #5416B5;
    --border-color: #e5e7eb;
    --shadow-color: rgba(127, 58, 161, 0.15);
    --glow-color: rgba(84, 22, 181, 0.6);
    --bg-gradient: none;
}

[data-theme="dark"] {
    /* Dark Mode (Ovde koristimo sve tvoje boje za pravi ugođaj) */
    --bg-color: #0C0516; /* Najtamnija */
    --text-color: #f3f4f6;
    --card-bg: #0F083B; /* Tamno plavo-ljubičasta za kartice */
    --primary-color: #7F3AA1; /* Svetlije ljubičasta */
    --primary-hover: #5416B5; /* Živopisna ljubičasta */
    --border-color: #5416B5;
    --shadow-color: rgba(15, 8, 59, 0.8);
    --glow-color: rgba(127, 58, 161, 0.6);
    /* Bogatiji, višeslojni mesh gradient */
    --bg-gradient: 
        radial-gradient(circle at 0% 0%, rgba(127, 58, 161, 0.5) 0%, transparent 50%),
        radial-gradient(circle at 100% 0%, rgba(84, 22, 181, 0.6) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(127, 58, 161, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(84, 22, 181, 0.5) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(15, 8, 59, 0.8) 0%, transparent 70%),
        linear-gradient(135deg, #0C0516 0%, #0F083B 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Nav */
header {
    background-color: var(--card-bg);
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 6px -1px var(--shadow-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    gap: 1.5rem;
    position: relative;
}

.theme-toggle-container {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 2rem; /* Povecano */
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px; /* Povecano */
    height: 55px; /* Povecano */
}

#theme-toggle:hover {
    transform: rotate(30deg);
}

.logo-container a {
    display: block;
    text-decoration: none;
}

.logo-placeholder {
    width: 200px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 3px;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.logo-placeholder:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--glow-color);
}

.nav-links-centered {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
    align-items: center;
}

.nav-links-centered a, .nav-links-centered button {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links-centered a::after, .nav-links-centered button::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links-centered a:hover, .nav-links-centered button:hover {
    color: var(--primary-color);
}

.nav-links-centered a:hover::after, .nav-links-centered button:hover::after {
    width: 100%;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex-grow: 1;
    width: 100%;
}

h1, h2, h3 {
    margin-bottom: 1rem;
}

/* Buttons / Categories */
.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.btn-category {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 2px solid var(--primary-color);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Glow Effect na hover */
.btn-category:hover {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-hover);
    box-shadow: 0 0 20px var(--glow-color), 0 0 40px var(--glow-color);
    transform: translateY(-3px);
}

.btn-category.active {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 15px var(--glow-color);
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.image-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 1px solid var(--border-color);
}

.image-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px var(--glow-color);
}

.image-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--border-color);
}

/* Admin Panel Styles */
.admin-panel {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 15px -3px var(--shadow-color);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 500px;
}

.admin-form input, .admin-form select {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
}

.admin-form input:focus, .admin-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--shadow-color);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--glow-color);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.3s;
}

.btn-danger:hover {
    opacity: 0.8;
}

.admin-list {
    margin-top: 2rem;
}

.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-list-item:last-child {
    border-bottom: none;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}
.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid #10b981;
}
.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    font-size: 1.2rem;
}

/* Novi JS Filter / Search Tagovi */
.filter-wrapper {
    max-width: 800px;
    margin: 0 auto 3rem auto;
    padding: 0 1rem;
}

.search-box-container {
    position: relative;
    width: 100%;
}

#style-search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#style-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--glow-color);
}

.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: none;
}

.suggestion-item {
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--text-color);
}

.suggestion-item:hover, .suggestion-item.active {
    background-color: var(--primary-color);
    color: #fff;
}

.active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.filter-tag {
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

.filter-tag .remove-tag {
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1;
}

.filter-tag .remove-tag:hover {
    color: #000;
}

.image-style-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(12, 5, 22, 0.8);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.image-card {
    position: relative;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === HERO SECTION === */
.hero-section {
    width: 100%;
    padding: 6rem 2rem;
    text-align: center;
    background: radial-gradient(circle at top, rgba(168, 85, 247, 0.15) 0%, transparent 60%);
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(168, 85, 247, 0.3);
}

.hero-content p {
    font-size: 1.2rem;
    color: #9ca3af;
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
}

/* === MOBILE RESPONSIVE (MAX 768px) === */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .theme-toggle-container {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }

    .logo-container {
        margin-bottom: 0.5rem;
    }

    .nav-links-centered {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .nav-links-centered a {
        font-size: 0.9rem;
        margin: 0;
        padding: 0.5rem;
    }

    .hero-section {
        padding: 4rem 1.5rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .category-buttons {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0 1rem 1rem 1rem;
        -webkit-overflow-scrolling: touch; /* smooth scrolling na iOS */
        scrollbar-width: none; /* Sakrij scrollbar firefox */
    }
    
    .category-buttons::-webkit-scrollbar {
        display: none; /* Sakrij scrollbar chrome/safari */
    }

    .category-buttons .btn-category {
        flex: 0 0 auto; /* Spreci smanjivanje dugmadi */
    }

    .image-grid {
        grid-template-columns: 1fr; /* Na mobilnom po jedna slika u redu */
        padding: 0 1rem;
    }

    .admin-panel {
        padding: 1.5rem;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(12, 5, 22, 0.95);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 30px var(--glow-color);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    color: white;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s, transform 0.3s;
}

.lightbox-close:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Cursor pointer za slike */
.image-card img {
    cursor: zoom-in;
}
