:root {
    --bg-color: #0c140e; /* Deep Forest Green */
    --card-bg: rgba(25, 35, 28, 0.7);
    --glass-border: rgba(197, 160, 89, 0.2); /* Gold-tinted border */
    --primary: #3d6b4a; /* Elegant Sage/Emerald */
    --primary-glow: rgba(61, 107, 74, 0.4);
    --secondary: #d4a5a5; /* Dusty Rose */
    --text-main: #f3f4f6;
    --text-muted: #a1a1aa;
    --accent-gold: #c5a059; /* Vintage Gold */
    --success: #689f38;
    --danger: #b71c1c;
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

.logo {
    font-family: 'Playfair Display', serif;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.logo:hover {
    color: var(--accent-gold);
    transform: scale(1.05);
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(61, 107, 74, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(212, 165, 165, 0.15) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

/* Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    position: sticky;
    top: 1rem;
    z-index: 100;
}

nav {
    display: flex;
    gap: 0.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

nav button {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 0.5rem;
    font-weight: 500;
}

nav button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

nav button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* Sections */
section {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

section.active {
    display: block;
}

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

/* Admin Dashboard Styles */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.form-card {
    padding: 2.5rem;
    height: fit-content;
    position: sticky;
    top: 6rem;
    background: linear-gradient(145deg, rgba(25, 35, 28, 0.9), rgba(15, 25, 18, 0.9));
}

.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-gold);
    margin-bottom: 0.6rem;
    font-weight: 600;
}

input:not([type="file"]), textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 0.9rem;
    border-radius: 12px;
    color: white;
    outline: none;
    transition: var(--transition);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
}

#product-image {
    display: none !important;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input:focus, textarea:focus {
    border-color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.07);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1.1rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 1.5rem; /* Increased gap above button */
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
}

/* Inventory List */
.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    padding: 1rem;
    gap: 1.5rem;
}

.product-thumb {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    background: #1e1e2e;
}

.stock-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.stock-ok { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stock-low { background: rgba(251, 191, 36, 0.1); color: var(--accent-gold); }
.stock-critical { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.stock-none { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--accent-gold);
    border-bottom: 2px solid var(--glass-border);
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Export Section */
.export-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.date-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-group input {
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
}

.btn-secondary {
    background: var(--glass-border);
    color: var(--text-main);
    border: 1px solid var(--accent-gold);
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--accent-gold);
    color: var(--bg-color);
}

/* Storefront Styles */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.store-card {
    padding: 0;
    overflow: hidden;
    transition: var(--transition);
}

.store-card:hover {
    transform: translateY(-10px);
}

.store-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--glass-border);
}

.card-content {
    padding: 1.5rem;
}

.price-tag {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin: 0.5rem 0;
}

.add-to-cart-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
}

.add-to-cart-btn.btn-success-flash {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Cart Overlay */
#cart-indicator {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 2.5rem;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.cart-items-list {
    margin-bottom: 2rem;
}

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

.cart-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-align: right;
}

/* Scrollbar */
.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

/* Mobile-First Adjustments and Refinements */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
        position: relative; /* Unstick on mobile for more space */
        top: 0;
    }

    .logo {
        font-size: 2rem;
    }

    .logo-container {
        align-items: center;
        text-align: center;
    }

    nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .store-grid {
        grid-template-columns: 1fr;
        padding: 0 0.5rem;
    }

    h1 {
        font-size: 2rem !important;
    }

    .product-item {
        grid-template-columns: 50px 1fr auto;
        padding: 0.8rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }
    
    nav button {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}
/* Added Styles */
.product-description {
    font-size: 0.85rem; /* Smaller font for front page */
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-upload-wrapper {
    margin-top: 2rem; /* Added gap above upload section */
    margin-bottom: 1.5rem;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background: rgba(197, 160, 89, 0.1);
    border: 1px dashed var(--accent-gold);
    color: var(--accent-gold);
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.pill-container {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.star-pill, .damaged-pill {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
    width: fit-content;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.star-pill {
    background: rgba(16, 185, 129, 0.9); /* Green for 'Istaknuto' */
    color: white;
}

.damaged-pill {
    background: rgba(197, 160, 89, 0.9); /* Gold for 'Niža klasa' */
    color: white;
}

.custom-footer {
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.custom-footer:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold);
}

.custom-footer p {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hide {
    display: none;
}

#product-image {
    display: none !important;
}

/* Image Slider Styles */
.product-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    height: 250px;
    background: #1e1e2e;
}

.image-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    height: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.image-slider::-webkit-scrollbar {
    display: none;
}

.image-slider img {
    min-width: 100%;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: start;
    flex-shrink: 0;
    border-bottom: none !important;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 5;
    transition: var(--transition);
}

.slider-btn:hover {
    background: var(--accent-gold);
}

.slider-btn.prev { left: 10px; }
.slider-btn.next { right: 10px; }

/* Layout Fix for Mobile Overlap */
.custom-request-box {
    position: relative !important;
    top: 0 !important;
    z-index: 5;
    margin-top: 2rem !important;
    margin-bottom: 5rem !important;
}


.cart-qty-badge {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 8px var(--primary-glow);
    animation: badgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgePop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Card Actions Row */
.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.card-actions .add-to-cart-btn {
    flex: 1;
    margin-top: 0;
}

.share-btn {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.share-btn:hover {
    background: var(--accent-gold);
    color: white;
    border-color: var(--accent-gold);
}


/* Logo Slogan */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-slogan {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.6;
    margin-top: -2px;
    letter-spacing: 2px;
    text-transform: lowercase;
}

/* Smaller Share Button next to title */
.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.share-btn-sm {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    transition: var(--transition);
    opacity: 0.6;
}

.share-btn-sm:hover {
    color: var(--accent-gold);
    opacity: 1;
    transform: scale(1.1);
}

/* Button with Qty indicator */
.btn-qty-tag {
    font-size: 0.7rem;
    margin-left: 8px;
    background: rgba(255,255,255,0.2);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 800;
}


/* Admin Panel Fixes */
.admin-body .app-container { max-width: 1400px !important; }
.admin-main { padding: 2rem; min-height: 80vh; }
.admin-grid { display: grid; grid-template-columns: 400px 1fr; gap: 2rem; align-items: start; }
#login-modal.active { display: flex !important; visibility: visible !important; opacity: 1 !important; }
#admin-content { width: 100%; }


/* Database Error Notice */
#db-error-notice {
    background: #ff4757;
    color: white;
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-bottom: 2px solid rgba(0,0,0,0.1);
    display: none;
}


/* Admin Display Force Fix */
body.logged-in #admin-content { display: block !important; opacity: 1 !important; visibility: visible !important; }
body.logged-in #login-modal { display: none !important; }
.admin-main { position: relative; z-index: 1; }


/* Force admin sections visible */
#admin-panel section { display: block !important; opacity: 1 !important; visibility: visible !important; }
.admin-body section { display: block !important; opacity: 1 !important; visibility: visible !important; }


/* Image 2 Admin Layout Fixes */
.admin-content-main { padding: 2rem 5%; }
.admin-title-section { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-title-section h1 { font-family: 'Playfair Display', serif; font-size: 2.5rem; color: white; margin: 0; }
.admin-title-section p { color: var(--text-muted); margin: 5px 0 0 0; }
.admin-grid-layout { display: grid; grid-template-columns: 350px 1fr; gap: 2rem; }
.admin-form-aside .form-card { padding: 2rem; }
.form-title { font-family: 'Playfair Display', serif; color: white; margin-bottom: 2rem; font-size: 1.5rem; }
.input-group label { display: block; font-size: 0.7rem; font-weight: 700; color: var(--accent-gold); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.filters-card { display: flex; gap: 1.5rem; align-items: flex-end; padding: 1.5rem 2rem; margin-bottom: 2rem; }
.filter-group { flex: 1; }
.filter-group label { display: block; font-size: 0.7rem; font-weight: 700; color: var(--accent-gold); margin-bottom: 8px; }
.filter-group input { width: 100%; padding: 0.8rem; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: white; }
.inventory-card { padding: 2rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.main-submit-btn { width: 100%; margin-top: 2rem; padding: 1.2rem; background: linear-gradient(135deg, #4a6741 0%, #a68b6d 100%); border: none; font-weight: 700; font-size: 0.9rem; }
@media (max-width: 1000px) { .admin-grid-layout { grid-template-columns: 1fr; } .admin-title-section { flex-direction: column; align-items: flex-start; gap: 1rem; } .filters-card { flex-wrap: wrap; } }


/* Premium Spacing & Typography Refinement */
.logo-container { gap: 4px; }
.logo-slogan { font-style: italic; opacity: 0.6; letter-spacing: 1px; font-size: 0.75rem; text-transform: none !important; }
.admin-header-main h1 { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 700; }
.form-card .input-group { margin-bottom: 1.5rem; }
.form-card label { margin-bottom: 10px; opacity: 0.9; }
.admin-table-root table th { font-size: 0.7rem; letter-spacing: 2px; color: var(--accent-gold); padding-bottom: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.admin-table-root table td { padding: 1.2rem 0; border-bottom: 1px solid rgba(255,255,255,0.03); }
.logout-top-right { background: rgba(255,71,87,0.1); border: 1px solid rgba(255,71,87,0.2); color: #ff4757; padding: 8px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.logout-top-right:hover { background: #ff4757; color: white; }


/* Final Aesthetic Polish */
.admin-body { font-family: 'Inter', sans-serif; background-color: #0d160d; }
.logo { font-size: 2.2rem !important; }
.admin-title-section h1 { font-size: 2.8rem !important; margin-bottom: 0.5rem; }
.admin-title-section p { font-size: 1.1rem; color: #8a8a8a; }
.form-card { border: 1px solid rgba(255,255,255,0.05); }
.form-title { font-size: 1.8rem !important; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 1rem; margin-bottom: 2rem !important; }
.input-group label { color: #c9a84c; font-size: 0.75rem; letter-spacing: 1.5px; margin-bottom: 12px; }
.main-submit-btn { border-radius: 12px; text-transform: uppercase; letter-spacing: 1px; transition: all 0.3s; }
.main-submit-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.4); }
.filters-card { border-radius: 15px; border: 1px solid rgba(255,255,255,0.03); }
.inventory-card { border-radius: 20px; border: 1px solid rgba(255,255,255,0.05); }
.admin-table-root table th { color: #8a8a8a; font-weight: 700; padding: 1.5rem 0.5rem; }
.admin-table-root table td { color: #e0e0e0; font-size: 0.95rem; }

