/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables for Design System - Dark Cyberpunk Theme */
:root {
    /* Primary Colors - Cyan/Teal Accent */
    --primary-color: #06B6D4;
    --primary-hover: #0891B2;
    --primary-dark: #0E7490;
    --secondary-color: #F59E0B;
    --secondary-hover: #D97706;
    --accent-color: #EC4899;
    --danger-color: #EF4444;
    --success-color: #10B981;
    
    /* Dark Theme Colors */
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;
    --text-dark: #6B7280;
    
    /* Background Colors */
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --bg-elevated: #1E293B;
    --bg-hover: #334155;
    
    /* Border & Divider Colors */
    --border-color: #334155;
    --border-light: #475569;
    
    /* Shadows with glow effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.3);
    --shadow-glow-secondary: 0 0 20px rgba(245, 158, 11, 0.3);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* General Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0A0E1A 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
    pointer-events: none !important;
    z-index: -1 !important;
}

body > * {
    position: relative;
    z-index: 1;
}

/* Ensure navbar and dropdown are above everything */
body > nav.navbar {
    z-index: 1040;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.h2 {
    font-size: 1.875rem;
    font-weight: 700;
}

/* Authentication Page */
.auth-page {
    background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 50%, #0F172A 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
    top: -250px;
    right: -250px;
    animation: pulse 4s ease-in-out infinite;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    bottom: -200px;
    left: -200px;
    animation: pulse 4s ease-in-out infinite 2s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.auth-page .card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.auth-page .nav-pills .nav-link {
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
    color: var(--text-secondary);
}

.auth-page .nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-glow);
    color: white;
}

.auth-page .nav-pills .nav-link:hover:not(.active) {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Navbar - Ensure it's always on top */
.navbar {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 0.875rem 1.5rem;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999 !important;
}

.navbar * {
    pointer-events: auto;
}

/* Adjust body padding to account for fixed navbar */
body {
    padding-top: 70px;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(6, 182, 212, 0.5);
}

.navbar .btn-light {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.navbar .btn-light:hover {
    background-color: var(--bg-hover);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 0;
    height: calc(100vh - 56px);
    overflow-y: hidden;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    box-shadow: var(--shadow-lg);
    border-right: 1px solid var(--border-color);
}

.sidebar .project-item {
    color: var(--text-primary);
}

.sidebar .project-item:hover {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.sidebar .project-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-md);
}

.sidebar .nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.875rem 1rem;
    margin: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    border: 1px solid transparent;
}

.sidebar .nav-link:hover {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-hover) 100%);
    color: var(--primary-color);
    transform: translateX(4px);
    border-color: var(--border-light);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-glow), var(--shadow-md);
    border-color: var(--primary-hover);
}

.sidebar .nav-link i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar #projectsList li {
    margin: 0.25rem 0;
}

.sidebar #projectsList a {
    padding: 0.625rem 1rem;
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    margin: 0.125rem 0.5rem;
}

.sidebar #projectsList a:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
    transform: translateX(4px);
    border-left-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.sidebar #projectsList a.fw-bold {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.1) 0%, transparent 100%);
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

/* Main Content */
main {
    min-height: calc(100vh - 150px);
    background: transparent;
    padding-top: 2rem !important;
}

main .border-bottom {
    border-color: var(--border-color) !important;
    padding-bottom: 1.5rem !important;
    margin-bottom: 2rem !important;
    position: relative;
}

main .border-bottom::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* Buttons */
.btn {
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.625rem 1.5rem;
    transition: var(--transition);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-glow), var(--shadow-md);
    border: 1px solid var(--primary-hover);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow), var(--shadow-lg);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow), var(--shadow-md);
}

.btn-outline-secondary {
    border: 2px solid var(--border-light);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3), var(--shadow-md);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, var(--success-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4), var(--shadow-lg);
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-elevated) 100%);
    backdrop-filter: blur(10px);
}

.card:hover {
    box-shadow: var(--shadow-lg), 0 0 30px rgba(6, 182, 212, 0.1);
    border-color: var(--border-light);
}

.card-header {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1.125rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
}

.card-body {
    padding: 1.5rem;
}

/* Project Cards */
.project-card {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 100%;
    border: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-elevated) 100%);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border-color: var(--primary-color);
}

.project-card .card-title {
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

.project-card .card-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-height: 42px;
    line-height: 1.6;
}

.project-card .badge {
    font-weight: 600;
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid var(--border-color);
}

.carousel-item img {
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: brightness(0.9) contrast(1.1);
}

.project-card:hover .carousel-item img {
    transform: scale(1.1);
    filter: brightness(1) contrast(1.2);
}

/* Preview Container */
.preview-container {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    min-height: 400px;
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.preview-container:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
}

.canvas-wrapper {
    display: inline-block;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

#previewCanvas {
    max-width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

/* Draggable Text */
.draggable-text {
    position: absolute;
    cursor: grab;
    user-select: none;
    z-index: 10;
    padding: 0;
    line-height: 1.2;
    background-color: rgba(79, 70, 229, 0.1);
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    /* Only animate visual styles, not position */
    transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
    will-change: transform;
}

.draggable-text.dragging {
    transition: none;
}

.draggable-text:hover {
    background-color: rgba(79, 70, 229, 0.2);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

.draggable-text:active {
    cursor: grabbing;
    background-color: rgba(79, 70, 229, 0.3);
    transform: scale(0.98);
}

/* Footer */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.footer .text-muted {
    color: var(--text-muted) !important;
}

/* Forms */
.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

.form-text i {
    margin-right: 0.25rem;
}

.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    transition: var(--transition);
    font-size: 0.95rem;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

.form-control-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
}

.badge.rounded-pill {
    border-radius: 50px;
}

/* Alerts */
.alert {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-sm);
}

.alert-danger {
    background-color: #FEE2E2;
    color: #991B1B;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        height: auto;
        position: relative;
    }
    
    .preview-container {
        min-height: 250px;
        padding: 1rem;
    }
    
    main {
        padding-top: 1rem !important;
    }
    
    .project-card:hover {
        transform: translateY(-4px);
    }
    
    .btn {
        padding: 0.625rem 1rem;
    }
    
    .h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* Modals - Must be above navbar (z-index: 9999) */
/* Hide modal backdrop completely to prevent blocking */
.modal-backdrop {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.modal-backdrop.show {
    display: none !important;
    opacity: 0 !important;
}

/* The modal container - must be above navbar */
.modal {
    z-index: 10500 !important;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Modal dialog - the actual popup box */
.modal-dialog {
    position: relative;
    z-index: 10501 !important;
    pointer-events: auto !important;
    margin: 1.75rem auto;
}

/* Modal content - ensure it's fully interactive */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-xl);
    background-color: var(--bg-secondary);
    position: relative;
    z-index: 10502 !important;
    pointer-events: auto !important;
}

/* When modal is shown, ensure dialog is interactive */
.modal.show .modal-dialog {
    pointer-events: auto !important;
}

.modal.show .modal-content {
    pointer-events: auto !important;
}

/* Override Bootstrap's default modal pointer-events behavior */
.modal.show {
    pointer-events: auto !important;
}

/* Ensure all form elements inside modals are interactive */
.modal input,
.modal select,
.modal textarea,
.modal button,
.modal .btn,
.modal .form-control,
.modal .form-select,
.modal .btn-close {
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.modal-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    pointer-events: auto;
}

.modal-title {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    pointer-events: auto;
}

.modal-body .form-control,
.modal-body .form-select,
.modal-body textarea,
.modal-body input {
    pointer-events: auto !important;
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    pointer-events: auto !important;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    background-color: var(--bg-secondary);
    pointer-events: auto;
}

.modal-footer .btn {
    pointer-events: auto !important;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.project-card {
    animation: fadeIn 0.4s ease-out;
}

.sidebar #projectsList li {
    animation: slideIn 0.3s ease-out;
}

/* Dropdown - Always on top of everything */
.navbar .dropdown {
    position: relative !important;
    z-index: 10000 !important;
}

/* Dropdown UL - Fix parent to allow clicks and stay on top */
.navbar .dropdown-menu {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    background-color: var(--bg-secondary);
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    z-index: 10001 !important;
    pointer-events: auto !important;
    display: none !important;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.navbar .dropdown-menu.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    z-index: 10001 !important;
    pointer-events: auto !important;
}

/* Ensure dropdown menu is above all page content */
.dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
    z-index: 10001 !important;
    pointer-events: auto !important;
}

/* List items in dropdown - ensure clicks work */
.navbar .dropdown-menu li {
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
    list-style: none;
}

/* Dropdown items - fully clickable */
.navbar .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    transition: var(--transition);
    color: var(--text-primary) !important;
    cursor: pointer !important;
    position: relative;
    z-index: 1;
    pointer-events: auto !important;
    display: block !important;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    white-space: nowrap;
}

.navbar .dropdown-item:hover {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

.navbar .dropdown-item:focus,
.navbar .dropdown-item:active {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    outline: none;
}

/* Logout button - highest priority */
#logoutBtn {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 2 !important;
    position: relative !important;
    background: none !important;
    border: none !important;
}

#logoutBtn:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

/* Sidebar Tools */
.sidebar .sidebar-tools {
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem;
    background-color: var(--bg-secondary);
}

.sidebar .sidebar-tools .form-control-sm {
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar .sidebar-tools .form-control-sm::placeholder {
    color: var(--text-muted);
}

.sidebar .sidebar-tools #projectsCount {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar .sidebar-tools #buildingsCount {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar .sidebar-tools .btn-sm {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Additional Text Visibility Fixes */
.form-control::placeholder,
.form-select::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.card-text,
.card-body p {
    color: var(--text-secondary);
}

.small,
small {
    color: var(--text-muted);
}

.text-muted {
    color: var(--text-muted) !important;
}

.badge {
    color: white;
}

.badge.bg-secondary {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

.badge.bg-primary {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Nav Pills */
.nav-pills .nav-link {
    color: var(--text-secondary);
    background-color: transparent;
    border: 1px solid var(--border-color);
    margin-right: 0.5rem;
}

.nav-pills .nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary-color);
}

/* Ensure icons are visible */
.bi {
    color: inherit;
}

/* Alert improvements */
.alert-info {
    color: var(--text-primary);
}

/* Card improvements */
.card h5,
.card h4 {
    color: var(--text-primary);
}

/* Sidebar building icon */
.sidebar .bi-building {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

/* Edit icon */
.edit-icon {
    opacity: 0.7;
    transition: var(--transition);
}

.edit-icon:hover {
    opacity: 1;
    color: var(--primary-color) !important;
}

/* Archive icon */
.archive-icon {
    opacity: 0.7;
    transition: var(--transition);
}

.archive-icon:hover {
    opacity: 1;
    color: var(--secondary-color) !important;
}

/* Project actions */
.project-actions {
    opacity: 0;
    transition: var(--transition);
}

.project-item:hover .project-actions {
    opacity: 1;
}

/* Creative Cards */
.creative-card {
    transition: var(--transition);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.creative-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(6, 182, 212, 0.15);
    border-color: var(--primary-color);
}

.creative-card img {
    transition: transform 0.3s ease;
}

.creative-card:hover img {
    transform: scale(1.05);
}

/* Modal XL for creative form */
.modal-xl {
    max-width: 1200px;
}

/* Ensure proper dark theme for modal */
.modal-body .card {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
}

.modal-body .card-header {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
}

/* Add Project button always visible */
#addBuildingBtn {
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

#addBuildingBtn:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Storage Widget Styles */
.storage-widget {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-top: 2px solid var(--border-color);
}

.storage-widget h6 {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.storage-widget .progress {
    background-color: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.storage-widget .progress-bar {
    transition: width 0.6s ease;
}

.storage-widget .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

.storage-widget small {
    font-size: 0.75rem;
}

.storage-widget small strong {
    color: var(--text-primary);
}

.storage-widget .alert {
    border-radius: var(--radius-sm);
    border: none;
}

.storage-widget .text-success {
    color: var(--success-color) !important;
}

.storage-widget .text-warning {
    color: var(--secondary-color) !important;
}

.storage-widget .text-danger {
    color: var(--danger-color) !important;
}
