* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --secondary-color: #4f46e5;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #0f172a;
    --sidebar-bg: #1e293b;
    --light-color: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --sidebar-width: 280px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--light-color);
    color: var(--text-main);
    overflow-x: hidden;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: white;
    box-shadow: var(--shadow-md);
    border: none;
    color: var(--dark-color);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.close-sidebar {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-footer {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#adminLogoutBtn {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    padding: 0.85rem;
    font-size: 0.95rem;
}

#adminLogoutBtn:hover {
    background: var(--danger-color);
    color: white;
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    padding: 3rem;
    background: var(--light-color);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    gap: 2rem;
}

.header-left h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.header-left p {
    color: var(--text-muted);
}

.btn-refresh {
    padding: 1rem 1.5rem;
    background: white;
    color: var(--dark-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: var(--light-color);
    transform: translateY(-1px);
}

/* Section Controls */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section.active {
    display: block;
}

/* Card Improvements */
.card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Form Styles - High End Refactor */
.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark-color);
    letter-spacing: -0.01em;
}

.form-group input:not([type="file"]),
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: #f8fafc;
    color: var(--text-main);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    min-height: 140px;
    line-height: 1.6;
}

.form-group input[type="file"] {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-muted);
}

.form-group input[type="file"]::file-selector-button {
    background: var(--primary-color);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.form-group input[type="file"]::file-selector-button:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Data List & Items - Modern Card Look */
.data-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.data-item {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.data-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light);
}

.data-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.data-item:hover::before {
    opacity: 1;
}

.data-item h4 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.data-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.data-item-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.data-item-actions button {
    flex: 1;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.empty-state {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* Pagination */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-controls label {
    font-weight: 600;
    color: var(--dark-color);
}

.pagination-controls select {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--text-color);
    font-size: 0.9rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--dark-color);
    color: white;
    border-radius: 5px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(150%);
    transition: transform 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.warning {
    background: var(--warning-color);
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Desktop Responsive */
@media (min-width: 1201px) {
    .main-content {
        margin-left: var(--sidebar-width);
    }
}

/* Base Bottom Nav Style (Hidden on Desktop) */
.bottom-nav {
    display: none;
}

/* Tablet & Mobile Responsive */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 0px;
    }

    .menu-toggle,
    .sidebar {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 2rem 1.25rem 7rem;
        /* Bottom padding for nav */
    }

    .content-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
        margin-bottom: 2.5rem;
    }

    .header-left h1 {
        font-size: 1.75rem;
    }

    /* Bottom Navigation Bar */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(30, 41, 59, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 0.75rem 0.5rem;
        z-index: 5000;
        justify-content: space-around;
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.2);
    }

    .bottom-nav .nav-item {
        flex-direction: column;
        align-items: center;
        padding: 0.5rem 0.15rem;
        gap: 0.25rem;
        color: #94a3b8;
        font-size: 0.6rem;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        font-weight: 700;
        flex: 1;
        min-width: 0;
    }

    .bottom-nav .nav-item i {
        font-size: 1.25rem;
        margin: 0;
    }

    .bottom-nav .nav-item.active {
        color: white;
        background: transparent;
        box-shadow: none;
    }

    .bottom-nav .nav-item.active i {
        color: var(--primary-light);
        transform: translateY(-2px);
    }

    /* Card adjustments for small screens */
    .card {
        padding: 1.75rem 1.25rem;
        border-radius: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* Fix horizontal scrolling on mobile */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Admin Login Overlay */
.admin-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-color);
    background-image: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.btn-back-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-back-login:hover {
    color: var(--primary-color);
}

.login-card {
    background: white;
    width: 100%;
    max-width: 420px;
    padding: 3.5rem 2.5rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeInScale 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: inline-block;
    background: #f1f5f9;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 20px;
}

.login-header h2 {
    color: var(--dark-color);
    font-size: 1.75rem;
    font-weight: 800;
}

.login-error {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fef2f2;
    color: var(--danger-color);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    display: none;
    border: 1px solid #fee2e2;
}

.login-error.active {
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Icon Picker Modern Styles */
.icon-picker-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.btn-icon-picker {
    padding: 0.9rem 1.5rem;
    background: #f1f5f9;
    color: var(--dark-color);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.btn-icon-picker:hover {
    background: #e2e8f0;
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-icon-picker:active {
    transform: translateY(0);
}

.icon-preview {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
    background: #f8fafc;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.icon-preview:hover {
    border-color: var(--primary-color);
    transform: scale(1.05) rotate(5deg);
}

/* Modal System */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: fadeInScale 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

/* Modal Enhancements */
.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark-color);
}

.modal-close {
    background: #f1f5f9;
    border: none;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
}

.icon-search {
    width: 100%;
    padding: 1.25rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    background: #f8fafc;
    transition: all 0.3s;
}

.icon-search:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.icon-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.category-btn {
    padding: 0.6rem 1.25rem;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    color: var(--text-muted);
}

.category-btn:hover {
    background: #f1f5f9;
    color: var(--dark-color);
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem;
}

.icon-item {
    background: white;
    padding: 1.5rem 1rem;
    border: 1px solid #f1f5f9;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.icon-item:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateY(-8px);
    box-shadow: 0 15px 30px -10px rgba(99, 102, 241, 0.2);
}

.icon-item i {
    font-size: 2.25rem;
    color: var(--primary-color);
    transition: all 0.3s;
}

.icon-item:hover i {
    transform: scale(1.15);
}

.icon-item span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    white-space: nowrap;
}

/* Data Items */
.data-item {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.2s;
}

.data-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.data-item-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.data-item-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.project-admin-preview {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.project-admin-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Helper Classes */
.btn-block {
    width: 100%;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}