:root {
    --primary: #1B4965;
    --secondary: #62B6CB;
    --accent: #BEE9E8;
    --highlight: #CAE9FF;
    --dark: #0D2B42;
    --light: #F7FBFC;
    --white: #FFFFFF;
    --text-dark: #1A1A2E;
    --text-light: #F5F5F5;
    --danger: #E74C3C;
    --success: #27AE60;
    --shadow: 0 4px 20px rgba(27, 73, 101, 0.1);
    --radius: 8px;
    --radius-sm: 4px;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--dark);
}

.btn-secondary {
    background: #6c757d;
    color: var(--white);
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
    padding: 20px;
}

.login-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
}

.logo-text {
    color: var(--primary);
}

.logo-accent {
    color: var(--secondary);
}

.logo-img {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

.login-header h1 {
    color: var(--primary);
    font-size: 28px;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
}

.login-form .form-group {
    position: relative;
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.login-form input {
    width: 100%;
    padding: 14px 14px 14px 45px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group i {
    position: absolute;
    left: 15px;
    top: 42px;
    color: #999;
}

.error-message {
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 15px;
    display: none;
}

.error-message.show {
    display: block;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--secondary);
    font-weight: 600;
}

.login-footer a:hover {
    color: var(--primary);
}

/* Dashboard Page */
.dashboard-page {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--primary);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar-header {
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 700;
}

.sidebar-header .logo-text {
    color: var(--white);
}

.sidebar-header .logo-accent {
    color: var(--secondary);
}

.sidebar-header .logo-img {
    max-height: 30px;
}

.admin-badge {
    background: var(--secondary);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.4);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-left-color: var(--secondary);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(231, 76, 60, 0.2);
    color: #ff6b6b;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 600;
}

.logout-btn:hover {
    background: var(--danger);
    color: var(--white);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.top-bar {
    background: var(--white);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--primary);
    cursor: pointer;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-name {
    font-weight: 600;
    color: var(--text-dark);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

/* Content Sections */
.content-section {
    display: none;
    padding: 30px;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 30px;
}

.section-header h1 {
    color: var(--primary);
    font-size: 28px;
    margin-bottom: 5px;
}

.section-header p {
    color: #666;
}

.content-actions {
    margin-bottom: 25px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 24px;
}

.stat-info h3 {
    font-size: 14px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

/* Quick Actions */
.quick-actions h2 {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 20px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: var(--white);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius);
    color: var(--text-dark);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.item-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(27, 73, 101, 0.15);
}

.item-image {
    height: 180px;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-image i {
    font-size: 50px;
    color: var(--secondary);
}

.item-content {
    padding: 20px;
}

.item-content h3 {
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 8px;
}

.item-content p {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.item-content .item-date {
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
}

.item-actions {
    display: flex;
    gap: 10px;
}

.item-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 10px;
    font-size: 13px;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    color: var(--primary);
    font-size: 22px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-form {
    padding: 25px;
}

.modal-form .form-group {
    margin-bottom: 20px;
}

.modal-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.modal-form input,
.modal-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.modal-form input:focus,
.modal-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

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

.modal-form input[type="file"] {
    padding: 10px;
    background: var(--light);
    border: 2px dashed var(--secondary);
    cursor: pointer;
}

.modal-form input[type="file"]:hover {
    border-color: var(--primary);
    background: var(--accent);
}

.modal-form small {
    display: block;
    text-align: center;
    color: #999;
    margin: 5px 0;
    font-style: italic;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
}

/* Gallery Group Card */
.gallery-group-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid var(--accent);
}

.gallery-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
}

.gallery-group-header h3 {
    font-size: 18px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-group-header .image-count {
    font-size: 13px;
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 15px;
}

.gallery-images-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 15px;
}

.gallery-thumb {
    position: relative;
    height: 120px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-thumb:hover img {
    transform: scale(1.1);
}

.more-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(27, 73, 101, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
}

.gallery-group-actions {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

@media (max-width: 768px) {
    .gallery-images-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 250px;
    padding: 15px 20px;
    background: var(--white);
    color: var(--text-dark);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s ease forwards;
    pointer-events: auto;
    border-left: 5px solid var(--primary);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.info {
    border-left-color: var(--secondary);
}

.toast.loading {
    border-left-color: var(--primary);
}

.toast i {
    font-size: 18px;
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--secondary); }

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.fade-out {
    animation: toastFadeOut 0.3s ease forwards;
}

@keyframes toastFadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.btn-sync {
    background: var(--light);
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-sync:hover {
    background: var(--primary);
    color: var(--white);
}