/* 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 - Professional Light Theme */
:root {
    /* Primary Colors - Professional Blue */
    --primary-color: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-dark: #1E40AF;
    --primary-light: #DBEAFE;
    --secondary-color: #6366F1;
    --secondary-hover: #4F46E5;
    --accent-color: #8B5CF6;
    --danger-color: #DC2626;
    --success-color: #059669;
    --warning-color: #D97706;

    /* Light Theme Text Colors */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;

    /* Background Colors - Clean White */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --bg-elevated: #FFFFFF;
    --bg-hover: #F3F4F6;
    --bg-sidebar: #F8FAFC;

    /* Border & Divider Colors */
    --border-color: #E5E7EB;
    --border-light: #D1D5DB;
    --border-focus: #2563EB;

    /* Professional Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.2s ease;
    --transition-fast: all 0.15s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 64px;
}

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

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

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

.auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    top: -300px;
    right: -300px;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    bottom: -250px;
    left: -250px;
}

.auth-page .card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    box-shadow: var(--shadow-xl);
}

.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: var(--primary-color);
    color: white;
}

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

/* Navbar */
.navbar {
    background: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 1.5rem;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030 !important;
    height: 64px;
}

.navbar * {
    pointer-events: auto;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    font-size: 1.5rem;
}

.navbar .btn-light {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
}

.navbar .btn-light:hover {
    background-color: var(--bg-hover);
    border-color: var(--border-light);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    height: calc(100vh - 64px);
    overflow-y: auto;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    width: 260px;
    z-index: 1020;
}

.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: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-md);
}

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

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

.sidebar .nav-link.active {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
    border-color: rgba(37, 99, 235, 0.2);
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.sidebar #projectsList li,
.sidebar #buildingsList li {
    margin: 0.125rem 0;
}

.sidebar #projectsList a,
.sidebar #buildingsList a {
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    margin: 0.125rem 0.5rem;
}

.sidebar #projectsList a:hover,
.sidebar #buildingsList a:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar #projectsList a.fw-bold,
.sidebar #buildingsList a.fw-bold {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
}

/* App Wrapper */
.app-wrapper {
    display: flex;
    width: 100%;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
}

/* Main Content */
main {
    flex: 1;
    background: var(--bg-secondary);
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    margin-left: 260px;
    width: calc(100% - 260px);
    box-sizing: border-box;
    overflow-y: auto;
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
}

main .border-bottom {
    border-color: var(--border-color) !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* Page Title Section - Remove margin and padding */
main > .d-flex.border-bottom,
main .d-flex.border-bottom {
    padding: 0 !important;
    margin: 0 !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* Admin/Other pages title sections */
main > .py-4,
main .py-4 > .d-flex:first-child,
main .py-4 > .text-center:first-child {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0.5rem !important;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    transition: var(--transition);
    border: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

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

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

.btn-outline-secondary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-light);
    color: var(--text-primary);
}

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

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    background: #047857;
    box-shadow: var(--shadow-md);
}

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

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

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

.btn-warning:hover {
    background: #B45309;
}

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

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    background: var(--bg-primary);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

/* Project Cards */
.project-card {
    transition: var(--transition);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 100%;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    position: relative;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.project-card .card-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.project-card .card-title .project-name-link {
    color: var(--primary-color);
    transition: all 0.2s ease;
    cursor: pointer;
}

.project-card .card-title .project-name-link:hover {
    color: var(--primary-hover);
    text-decoration: underline !important;
}

.project-card .card-title .project-name-link:hover i {
    opacity: 1 !important;
}

.project-card .card-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    min-height: 40px;
    line-height: 1.5;
}

.project-card .badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.carousel-item img {
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .carousel-item img {
    transform: scale(1.05);
}

/* Preview Container */
.preview-container {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    min-height: 400px;
    background: var(--bg-primary);
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.preview-container:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.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: 2px 6px;
    line-height: 1.2;
    background: rgba(255, 255, 255, 0.5) !important;
    border: none !important;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    will-change: transform;
    box-shadow: none !important;
}

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

.draggable-text:hover {
    background: rgba(255, 255, 255, 0.55) !important;
    border: 1px dashed rgba(37, 99, 235, 0.5) !important;
    box-shadow: none !important;
}

.draggable-text:active {
    cursor: grabbing;
    background: rgba(255, 255, 255, 0.6) !important;
}

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

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

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

.form-text {
    font-size: 0.8125rem;
    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.5rem 0.75rem;
    transition: var(--transition);
    font-size: 0.875rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

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

.form-control-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

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

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

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

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

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

.badge.bg-info {
    background-color: #0EA5E9 !important;
    color: white !important;
}

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

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

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

.alert-warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.alert-info {
    background-color: #DBEAFE;
    color: #1E40AF;
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        width: 100%;
        position: relative;
        top: auto;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    main {
        margin-left: 0;
    }

    .footer {
        margin-left: 0;
    }
}

@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(-2px);
    }

    .btn {
        padding: 0.5rem 0.875rem;
    }

    .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.15em;
}

/* Modals */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

.modal-dialog {
    margin: 1.75rem auto;
}

.modal-content {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    background-color: var(--bg-primary);
}

.modal-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

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

.modal-body {
    padding: 1.25rem;
}

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

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

.btn-close {
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* Dropdown */
.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-primary);
    min-width: 200px;
}

.navbar .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.875rem;
    transition: var(--transition);
    color: var(--text-primary) !important;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.navbar .dropdown-item i {
    color: var(--text-muted);
    width: 1rem;
}

.navbar .dropdown-divider {
    border-color: var(--border-color);
    margin: 0.375rem 0;
}

#logoutBtn {
    cursor: pointer;
    color: var(--danger-color) !important;
}

#logoutBtn:hover {
    background-color: #FEE2E2 !important;
}

#logoutBtn i {
    color: var(--danger-color);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

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

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

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

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

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

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

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

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

/* Text & Content Styling */
.form-control::placeholder,
.form-select::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

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

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

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

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

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

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

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

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

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

.nav-pills .nav-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Icons */
.bi {
    color: inherit;
}

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

/* Sidebar building icon */
.sidebar .bi-building,
.sidebar .bi-folder {
    color: var(--primary-color);
}

/* Project action badges */
.project-actions .badge {
    padding: 0.25rem 0.4rem;
    font-size: 0.7rem;
    transition: var(--transition);
}

.project-actions .edit-icon:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

.project-actions .archive-icon:hover {
    background-color: var(--warning-color) !important;
    color: #fff !important;
}

.project-actions .delete-icon:hover {
    background-color: var(--danger-color) !important;
    color: #fff !important;
}

/* Project actions visibility */
.project-actions {
    opacity: 1;
}

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

.creative-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    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;
}

/* Add Project button */
#addBuildingBtn {
    box-shadow: var(--shadow-sm);
}

#addBuildingBtn:hover {
    box-shadow: var(--shadow-md);
}

/* Plan Widget Styles */
.plan-widget {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.plan-widget h6 {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-widget h6 i {
    color: var(--primary-color);
}

.plan-widget .badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
}

/* Storage Widget Styles */
.storage-widget {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
}

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

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

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

.storage-widget .badge {
    font-size: 0.6875rem;
    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;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

/* Project Tabs Navigation */
.project-tabs {
    border-bottom: 1px solid var(--border-color);
    gap: 0;
    background: var(--bg-primary);
    padding: 0 1rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.project-tabs .nav-item {
    margin-bottom: -1px;
}

.project-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.875rem 1.25rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    background: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-tabs .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: rgba(37, 99, 235, 0.3);
}

.project-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.project-tabs .nav-link .badge {
    font-size: 0.6875rem;
    padding: 0.2rem 0.5rem;
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-full);
}

.project-tabs .nav-link.active .badge {
    background: var(--primary-color) !important;
    color: white !important;
}

.project-tabs .nav-link i {
    font-size: 1rem;
}

/* Responsive tabs */
@media (max-width: 576px) {
    .project-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 0.5rem;
    }

    .project-tabs .nav-link {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    .project-tabs .nav-link .badge {
        display: none;
    }
}

/* WhatsApp Rich Text Toolbar */
.wa-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    position: relative;
}

.wa-toolbar .btn-group .btn {
    padding: 0.375rem 0.625rem;
    border-color: var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.wa-toolbar .btn-group .btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.wa-toolbar .format-btn[data-format="bold"] i {
    font-weight: 900;
}

.wa-toolbar + textarea.form-control {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Emoji Picker */
.emoji-picker {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    width: 320px;
    max-width: 90vw;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 0.25rem;
}

.emoji-picker.show {
    display: block;
}

.emoji-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem;
    gap: 0.25rem;
    overflow-x: auto;
}

.emoji-tab {
    background: transparent;
    border: none;
    padding: 0.375rem 0.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.emoji-tab:hover {
    background: var(--bg-tertiary);
}

.emoji-tab.active {
    background: var(--primary-light);
}

.emoji-content {
    padding: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.25rem;
}

.emoji-item {
    font-size: 1.5rem;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    text-align: center;
    transition: var(--transition-fast);
    line-height: 1;
}

.emoji-item:hover {
    background: var(--bg-tertiary);
    transform: scale(1.2);
}

/* Preview with WhatsApp formatting */
#previewOutput strong {
    font-weight: 700;
}

#previewOutput em {
    font-style: italic;
}

#previewOutput del {
    text-decoration: line-through;
    opacity: 0.7;
}

#previewOutput code {
    font-family: 'Courier New', monospace;
    background: var(--bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.9em;
}

#previewOutput {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* WhatsApp formatting hint */
.form-text code {
    background: var(--bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.85em;
    color: var(--primary-color);
    margin: 0 0.125rem;
}

/* Responsive emoji picker */
@media (max-width: 576px) {
    .emoji-picker {
        width: 280px;
    }

    .emoji-content {
        grid-template-columns: repeat(6, 1fr);
    }

    .emoji-item {
        font-size: 1.25rem;
    }
}

/* Tables */
.table {
    color: var(--text-primary);
}

.table thead th {
    background-color: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1rem;
}

.table tbody td {
    border-bottom: 1px solid var(--border-color);
    padding: 0.875rem 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: var(--bg-tertiary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border-light);
}

.empty-state h5 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Pagination */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.page-link:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.disabled .page-link {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* Breadcrumbs */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-primary);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* List Groups */
.list-group-item {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.875rem 1rem;
}

.list-group-item:first-child {
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.list-group-item:last-child {
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.list-group-item-action:hover {
    background-color: var(--bg-tertiary);
}

/* Tooltips */
.tooltip-inner {
    background-color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
    border-top-color: var(--text-primary);
}

.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
    border-bottom-color: var(--text-primary);
}

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

.image-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.image-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-card .card-body {
    padding: 1rem;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.video-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.video-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.video-card video {
    width: 100%;
    height: auto;
    display: block;
}

/* Progress Bars */
.progress {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    background-color: var(--primary-color);
}

.progress-bar.bg-success {
    background-color: var(--success-color) !important;
}

.progress-bar.bg-warning {
    background-color: var(--warning-color) !important;
}

.progress-bar.bg-danger {
    background-color: var(--danger-color) !important;
}

/* Action Buttons Row */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* Status Indicators */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-dot.success {
    background-color: var(--success-color);
}

.status-dot.warning {
    background-color: var(--warning-color);
}

.status-dot.danger {
    background-color: var(--danger-color);
}

.status-dot.info {
    background-color: #0EA5E9;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2,
.section-header h3 {
    margin-bottom: 0;
}

/* Stats Cards */
.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

/* Utility Classes */
.bg-white {
    background-color: var(--bg-primary) !important;
}

.border-0 {
    border: none !important;
}

.shadow-none {
    box-shadow: none !important;
}

.rounded-lg {
    border-radius: var(--radius-lg) !important;
}

.rounded-xl {
    border-radius: var(--radius-xl) !important;
}

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

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Plan Info Card */
#planInfo {
    padding: 1rem;
    background: var(--bg-secondary);
}

#planInfo .badge {
    font-size: 0.6875rem;
}

/* Subscription Plan Badge Colors */
.badge-plan-free {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

.badge-plan-basic {
    background-color: #DBEAFE !important;
    color: #1E40AF !important;
}

.badge-plan-pro {
    background-color: #F3E8FF !important;
    color: #7C3AED !important;
}

.badge-plan-enterprise {
    background-color: #FEF3C7 !important;
    color: #92400E !important;
}

/* Select2 Custom Styling for Light Theme */
.select2-container--default .select2-selection--single {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    height: auto;
    padding: 0.375rem 0.5rem;
}

.select2-container--default .select2-selection--single:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary);
}

.select2-dropdown {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color);
    color: white;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

/* Notiflix Custom Styling */
.notiflix-notify {
    font-family: 'Inter', sans-serif !important;
}

/* ===================================
   ENHANCED UI COMPONENTS
   =================================== */

/* Standardized Button Sizes */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
}

.btn-icon-lg {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
}

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spinner 0.6s linear infinite;
}

@keyframes btn-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Ripple Effect for Buttons */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

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

.btn-ripple:active::before {
    width: 300px;
    height: 300px;
}

/* ===================================
   SKELETON LOADING SCREENS
   =================================== */

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text-sm {
    height: 12px;
    width: 60%;
}

.skeleton-title {
    height: 20px;
    width: 80%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 180px;
    border-radius: var(--radius-md);
}

.skeleton-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.skeleton-card .skeleton-image {
    margin-bottom: 1rem;
}

/* ===================================
   FORM VALIDATION STYLES
   =================================== */

.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23059669' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23DC2626'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23DC2626' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.form-control.is-valid:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.form-control.is-invalid:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.valid-feedback {
    display: none;
    color: var(--success-color);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.invalid-feedback {
    display: none;
    color: var(--danger-color);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.is-valid ~ .valid-feedback,
.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Input Group Enhancements */
.input-group-text {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Floating Labels */
.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 2px);
    padding: 1rem 0.75rem;
}

.form-floating > label {
    padding: 1rem 0.75rem;
    color: var(--text-muted);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    color: var(--primary-color);
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* ===================================
   ENHANCED CARD COMPONENTS
   =================================== */

.card-hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.card-hover-glow:hover {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), var(--shadow-lg);
}

/* Card with Image Overlay */
.card-image-overlay {
    position: relative;
    overflow: hidden;
}

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

.card-image-overlay:hover img {
    transform: scale(1.08);
}

.card-image-overlay .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.card-image-overlay:hover .overlay {
    opacity: 1;
}

/* Card Actions */
.card-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.card:hover .card-actions {
    opacity: 1;
}

.card-actions .btn {
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    box-shadow: var(--shadow-sm);
}

.card-actions .btn:hover {
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

/* ===================================
   ENHANCED EMPTY STATES
   =================================== */

.empty-state-enhanced {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border-color);
}

.empty-state-enhanced .empty-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.empty-state-enhanced .empty-icon i {
    font-size: 2rem;
    color: var(--text-muted);
}

.empty-state-enhanced h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.empty-state-enhanced p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-enhanced .btn {
    padding: 0.625rem 1.5rem;
}

/* ===================================
   BREADCRUMB ENHANCED
   =================================== */

.breadcrumb-enhanced {
    background: var(--bg-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.breadcrumb-enhanced .breadcrumb {
    margin-bottom: 0;
}

.breadcrumb-enhanced .breadcrumb-item {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.breadcrumb-enhanced .breadcrumb-item i {
    margin-right: 0.375rem;
}

.breadcrumb-enhanced .breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb-enhanced .breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-enhanced .breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===================================
   TOAST NOTIFICATIONS
   =================================== */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.custom-toast {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 320px;
    max-width: 420px;
    animation: slideInRight 0.3s ease;
}

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

.custom-toast.toast-hiding {
    animation: slideOutRight 0.3s ease forwards;
}

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

.custom-toast .toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-toast.toast-success .toast-icon {
    background: #D1FAE5;
    color: var(--success-color);
}

.custom-toast.toast-error .toast-icon {
    background: #FEE2E2;
    color: var(--danger-color);
}

.custom-toast.toast-warning .toast-icon {
    background: #FEF3C7;
    color: var(--warning-color);
}

.custom-toast.toast-info .toast-icon {
    background: #DBEAFE;
    color: var(--primary-color);
}

.custom-toast .toast-content {
    flex: 1;
}

.custom-toast .toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    font-size: 0.9375rem;
}

.custom-toast .toast-message {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.4;
}

.custom-toast .toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    transition: color 0.15s ease;
}

.custom-toast .toast-close:hover {
    color: var(--text-primary);
}

/* ===================================
   MODAL ENHANCEMENTS
   =================================== */

.modal-enhanced .modal-content {
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-enhanced .modal-header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
}

.modal-enhanced .modal-title {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-enhanced .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-enhanced .btn-close:hover {
    opacity: 1;
}

.modal-enhanced .modal-body {
    padding: 1.5rem;
}

.modal-enhanced .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Modal Slide Animation */
.modal.fade .modal-dialog {
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.2s ease;
}

.modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}

/* ===================================
   ENHANCED SIDEBAR
   =================================== */

.sidebar-nav-item {
    position: relative;
    margin: 0.25rem 0;
}

.sidebar-nav-item .nav-link {
    position: relative;
    overflow: hidden;
}

.sidebar-nav-item .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.sidebar-nav-item .nav-link.active::before,
.sidebar-nav-item .nav-link:hover::before {
    transform: scaleY(1);
}

/* Project Item Animation */
.project-item-animated {
    animation: fadeInUp 0.3s ease;
}

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

/* ===================================
   MICRO-INTERACTIONS
   =================================== */

/* Checkbox Custom Style */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-check-input {
    transition: all 0.15s ease;
}

.form-check-input:checked {
    animation: checkBounce 0.3s ease;
}

@keyframes checkBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Switch Style */
.form-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
    background-color: var(--border-light);
}

.form-switch .form-check-input:checked {
    background-color: var(--primary-color);
}

/* Badge Animation */
.badge-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
    }
}

/* Counter Animation */
.count-up {
    transition: all 0.3s ease;
}

/* Icon Rotation on Hover */
.icon-rotate-hover:hover i {
    transform: rotate(90deg);
    transition: transform 0.3s ease;
}

.icon-rotate-hover i {
    transition: transform 0.3s ease;
}

/* Scale on Click */
.scale-on-click:active {
    transform: scale(0.95);
}

/* ===================================
   MOBILE RESPONSIVENESS ENHANCED
   =================================== */

@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        top: 64px;
        left: -280px;
        width: 280px;
        height: calc(100vh - 64px);
        z-index: 1040;
        transition: left 0.3s ease;
        border-right: 1px solid var(--border-color);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        top: 64px;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1039;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-toggle {
        display: flex !important;
    }

    main {
        margin-left: 0;
    }

    .footer {
        margin-left: 0;
    }
}

@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: var(--bg-hover);
}

.mobile-menu-toggle i {
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* Touch-friendly buttons on mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 0.625rem 1rem;
    }

    .btn-sm {
        min-height: 36px;
        padding: 0.5rem 0.875rem;
    }

    .form-control,
    .form-select {
        min-height: 44px;
        padding: 0.625rem 0.875rem;
    }

    .nav-link {
        padding: 0.875rem 1rem;
    }

    /* Stack buttons on mobile */
    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    /* Full width modals on mobile */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    /* Horizontal scroll for tabs */
    .project-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .project-tabs::-webkit-scrollbar {
        display: none;
    }

    .project-tabs .nav-item {
        flex-shrink: 0;
    }
}

/* ===================================
   ACCESSIBILITY IMPROVEMENTS
   =================================== */

/* Focus visible states */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: none;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    z-index: 9999;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-muted: #333;
    }

    .btn {
        border: 2px solid currentColor;
    }
}

/* ===================================
   UTILITY CLASSES
   =================================== */

/* Flex utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-start {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* Gap utilities */
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.gap-xl { gap: 2rem; }

/* Aspect ratio utilities */
.aspect-square {
    aspect-ratio: 1;
}

.aspect-video {
    aspect-ratio: 16/9;
}

.aspect-portrait {
    aspect-ratio: 3/4;
}

/* Truncate text */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* ===================================
   LOADING OVERLAY
   =================================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   DATA TABLE ENHANCEMENTS
   =================================== */

.table-responsive-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-responsive-card .table {
    margin-bottom: 0;
}

.table-responsive-card .table thead th {
    background: var(--bg-secondary);
    border-top: none;
}

.table-responsive-card .table tbody tr:last-child td {
    border-bottom: none;
}

/* Sortable table headers */
.table-sortable th {
    cursor: pointer;
    user-select: none;
}

.table-sortable th:hover {
    background: var(--bg-tertiary);
}

.table-sortable th .sort-icon {
    margin-left: 0.25rem;
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.table-sortable th:hover .sort-icon {
    opacity: 0.6;
}

.table-sortable th.sorted .sort-icon {
    opacity: 1;
    color: var(--primary-color);
}

/* ===================================
   DROPDOWN ENHANCEMENTS
   =================================== */

.dropdown-menu-animated {
    animation: dropdownFadeIn 0.2s ease;
}

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

/* Dropdown with icons */
.dropdown-item-icon {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.dropdown-item-icon i {
    width: 1.25rem;
    text-align: center;
    color: var(--text-muted);
}

.dropdown-item-icon:hover i {
    color: var(--primary-color);
}

/* ===================================
   PRICING CARDS
   =================================== */

.pricing-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.pricing-card.popular {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.pricing-card.popular::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-card .price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.pricing-card .price-period {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
}

.pricing-card .features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    text-align: left;
}

.pricing-card .features li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.pricing-card .features li i {
    color: var(--success-color);
}

.pricing-card .features li.disabled {
    color: var(--text-muted);
    text-decoration: line-through;
}

.pricing-card .features li.disabled i {
    color: var(--text-muted);
}

/* ===================================
   MEDIA PREVIEW MODAL
   =================================== */

.media-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.media-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.media-modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    z-index: 1;
}

.media-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.media-modal-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.media-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.media-modal-body {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    max-height: calc(90vh - 120px);
}

.media-modal-image {
    max-width: 100%;
    max-height: calc(90vh - 150px);
    object-fit: contain;
    border-radius: var(--radius-md);
}

.media-modal-video {
    max-width: 100%;
    max-height: calc(90vh - 150px);
    border-radius: var(--radius-md);
    background: #000;
}

.media-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.media-modal-footer .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Video card play overlay */
.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.video-play-overlay:hover {
    background: rgba(0, 0, 0, 0.5);
}

.video-play-overlay i {
    font-size: 3rem;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #000;
}

/* ==================== Select2 Custom Styles ==================== */

/* Select2 container styling */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    min-height: 38px !important;
    background: var(--bg-primary) !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.select2-container--bootstrap-5 .select2-selection--single {
    padding: 0.375rem 2.25rem 0.375rem 0.75rem !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary) !important;
    line-height: 1.5 !important;
    padding-left: 0 !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
    color: var(--text-muted) !important;
}

/* Focus state */
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25) !important;
}

/* Dropdown styling */
.select2-container--bootstrap-5 .select2-dropdown {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    background: var(--bg-primary) !important;
    z-index: 9999 !important;
}

/* Search input in dropdown */
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.5rem 0.75rem !important;
}

.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25) !important;
    outline: none !important;
}

/* Dropdown options */
.select2-container--bootstrap-5 .select2-results__option {
    padding: 0.5rem 0.75rem !important;
    color: var(--text-primary) !important;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.select2-container--bootstrap-5 .select2-results__option[aria-selected=true] {
    background-color: var(--primary-light) !important;
    color: var(--primary-color) !important;
}

/* Multiple select styling */
.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 38px !important;
    padding: 0.25rem 0.5rem !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: var(--primary-light) !important;
    border: 1px solid var(--primary-color) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--primary-dark) !important;
    padding: 0.15rem 0.5rem !important;
    margin: 0.15rem !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--primary-color) !important;
    margin-right: 0.25rem !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: var(--danger-color) !important;
}

/* Clear button styling */
.select2-container--bootstrap-5 .select2-selection__clear {
    color: var(--text-muted) !important;
    font-size: 1rem !important;
    margin-right: 0.25rem !important;
}

.select2-container--bootstrap-5 .select2-selection__clear:hover {
    color: var(--danger-color) !important;
}

/* Small select variant */
.select2-container--bootstrap-5 .select2-selection--single.form-select-sm,
.form-select-sm + .select2-container--bootstrap-5 .select2-selection {
    min-height: 31px !important;
    padding: 0.25rem 2rem 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
}

/* Disabled state */
.select2-container--bootstrap-5.select2-container--disabled .select2-selection {
    background-color: var(--bg-tertiary) !important;
    cursor: not-allowed !important;
    opacity: 0.65 !important;
}

/* Modal z-index fix */
.modal .select2-container--bootstrap-5 .select2-dropdown {
    z-index: 10060 !important;
}

/* Arrow styling */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 0.75rem !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-muted) transparent transparent transparent !important;
}

/* Loading indicator */
.select2-container--bootstrap-5 .select2-results__option--load-more,
.select2-container--bootstrap-5 .select2-results__option--loading {
    color: var(--text-muted) !important;
    font-style: italic !important;
}
