/* Modern Dashboard Styles - Enhanced */

/* Custom Scrollbar Styling */
/* For Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.6), rgba(168, 85, 247, 0.6));
    border-radius: 10px;
    border: 2px solid rgba(15, 23, 42, 0.5);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.8), rgba(168, 85, 247, 0.8));
    border-color: rgba(15, 23, 42, 0.3);
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(135deg, #60a5fa, #a855f7);
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 165, 250, 0.6) rgba(15, 23, 42, 0.5);
}

/* Global modern layout styles */
body.modern-layout {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0b14;
    background-image: none;
    background-image: radial-gradient(circle at 25% 25%, #1e293b 0%, transparent 50%), radial-gradient(circle at 75% 75%, #312e81 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 0;
    color: #f1f5f9;
    /* Добавяме flexbox структура за sticky footer */
    display: flex;
    flex-direction: column;
}

/* Modern container for all pages */
.modern-container {
    max-width: none;
    padding: 0;
    /* Разтягаме контейнера да заема свободното пространство */
    flex: 1 0 auto;
}

.modern-main {
    min-height: calc(100vh - 200px);
    padding: 20px;
}

/* Enhanced Dashboard header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.dashboard-logo {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

    .dashboard-logo:hover {
        text-decoration: none;
        transform: scale(1.05);
        filter: brightness(1.2);
    }

.dashboard-user-info {
    color: #94a3b8;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 16px;
}

    .dashboard-user-info .welcome {
        color: #f1f5f9;
        font-weight: 600;
    }

/* Modern select dropdown */
.modern-select {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    color: #f1f5f9 !important;
    padding: 8px 32px 8px 12px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: auto !important;
    display: inline-block !important;
}

    .modern-select:hover {
        background: rgba(30, 41, 59, 1) !important;
        border-color: #60a5fa !important;
    }

    .modern-select:focus {
        outline: none !important;
        border-color: #60a5fa !important;
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1) !important;
    }

/* Modern button */
.modern-btn {
    background: linear-gradient(135deg, #60a5fa, #a855f7) !important;
    border: none !important;
    color: white !important;
    padding: 8px 20px !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    font-family: inherit !important;
    display: inline-flex !important;
    align-items: center !important;
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3) !important;
}

    .modern-btn:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 25px rgba(96, 165, 250, 0.4) !important;
    }

    .modern-btn:active {
        transform: translateY(0) !important;
    }

.dashboard-logout-form {
    margin: 0;
    display: inline;
}

/* Auth links for non-authenticated users */
.auth-links {
    display: flex;
    gap: 12px;
}

.auth-link {
    color: #94a3b8;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

    .auth-link:hover {
        background: rgba(30, 41, 59, 0.5);
        border-color: #60a5fa;
        color: #f1f5f9;
        text-decoration: none;
    }

/* Modern footer */
.modern-footer {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(15, 23, 42, 0.5);
    /* Гарантираме, че footer-ът не се свива */
    flex-shrink: 0;
}

.modern-footer-content {
    font-size: 14px;
}

.modern-footer a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.3s ease;
}

    .modern-footer a:hover {
        color: #a855f7;
        text-decoration: none;
    }

/* Dashboard-specific styles (for Admin Dashboard page) */
body.dashboard-page .modern-main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 160px);
    padding: 40px 20px;
}

.dashboard-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    max-width: 1100px;
    width: 100%;
}

/* Enhanced dashboard cards */
.dashboard-card {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 20px;
    padding: 36px 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(255, 255, 255, 0.05);
    text-decoration: none;
    color: inherit;
}

    /* Gradient border effect */
    .dashboard-card::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 20px;
        padding: 2px;
        background: linear-gradient(135deg, transparent, rgba(96, 165, 250, 0.3), transparent);
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        opacity: 0;
        transition: opacity 0.4s ease;
    }

    /* Shine effect */
    .dashboard-card::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.08), transparent);
        transform: rotate(45deg);
        transition: all 0.6s ease;
        opacity: 0;
    }

    .dashboard-card:hover::before {
        opacity: 1;
        left: 100%;
        top: 100%;
    }

    .dashboard-card:hover::after {
        opacity: 1;
    }

    .dashboard-card:hover {
        transform: translateY(-10px) scale(1.02);
        border-color: rgba(96, 165, 250, 0.4);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 
                    0 0 0 1px rgba(96, 165, 250, 0.3),
                    0 0 40px rgba(96, 165, 250, 0.2);
        text-decoration: none;
        color: inherit;
    }

/* Enhanced icon styling */
.card-icon {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 28px;
    position: relative;
    z-index: 1;
    transition: all 0.4s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.dashboard-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.card-icon.create {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    color: white;
}

.card-icon.view {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: white;
}

.card-icon.edit {
    background: linear-gradient(135deg, #fb923c, #f97316);
    color: white;
}

.card-icon.check {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.dashboard-card:hover .card-title {
    color: #60a5fa;
}

.card-description {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Content styling for other pages */
.modern-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Override Bootstrap card styling for modern theme */
body.modern-layout .card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(20px);
}

body.modern-layout .card-header {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(168, 85, 247, 0.1));
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    color: #f1f5f9;
}

body.modern-layout .card-body {
    color: #f1f5f9;
}

body.modern-layout h1,
body.modern-layout h2,
body.modern-layout h3,
body.modern-layout h4,
body.modern-layout h5,
body.modern-layout h6 {
    color: #f1f5f9;
}

/* Responsive design */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 400px;
    }

    .dashboard-card {
        min-height: 180px;
        padding: 32px 24px;
    }

    /* Modified header for mobile - keep horizontal layout for customer dashboard */
    .dashboard-header {
        padding: 16px 20px;
    }

    /* Keep user info horizontal on mobile for better layout */
    .dashboard-user-info {
        flex-direction: row;
        justify-content: flex-end;
        gap: 12px;
        align-items: center;
    }

    /* Hide desktop language dropdown on mobile */
    .desktop-language {
        display: none;
    }

    /* Show mobile language toggle on mobile */
    .mobile-language {
        display: inline;
    }

    /* Hide logout text on mobile, keep only icon */
    .logout-btn .logout-text {
        display: none;
    }

    .logout-btn .logout-icon {
        margin-right: 0 !important;
    }

    .logout-btn {
        padding: 8px 12px !important;
        min-width: auto;
    }

    /* Adjust flag button size for mobile */
    .flag-toggle-btn {
        padding: 6px 10px;
    }

    .flag-icon {
        font-size: 22px;
    }

    /* Equal size for all header buttons on mobile */
    .flag-toggle-btn,
    .theme-toggle-btn,
    .logout-btn {
        min-width: 36px !important;
        width: 36px !important;
        height: 36px !important;
        padding: 6px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .flag-icon,
    .theme-icon {
        font-size: 18px !important;
    }

    .logout-btn .logout-icon {
        width: 18px !important;
        height: 18px !important;
    }

    body.dashboard-page .modern-main {
        padding: 20px 16px;
    }

    /* Thinner scrollbar on mobile */
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        max-width: 100%;
    }

    .card-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .card-title {
        font-size: 18px;
    }

    .card-description {
        font-size: 13px;
    }

    /* Even thinner scrollbar on small mobile */
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
}

/* SVG icons styling */
.dashboard-card svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Language Toggle Styles */
.language-form {
    margin: 0;
    display: inline;
}

/* Desktop language dropdown - visible by default */
.desktop-language {
    display: inline;
}

/* Mobile language toggle - hidden by default */
.mobile-language {
    display: none;
}

/* Flag toggle button for mobile */
.flag-toggle-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.flag-toggle-btn:hover {
    background: rgba(30, 41, 59, 1);
    border-color: #60a5fa;
    transform: translateY(-2px);
}

.flag-icon {
    font-size: 24px;
    line-height: 1;
    display: inline-block;
}

@media (max-width: 480px) {
    .dashboard-header {
        padding: 12px 16px;
    }

    .dashboard-logo {
        font-size: 20px;
    }

    .dashboard-logo svg {
        width: 28px;
        height: 28px;
        margin-right: 6px;
    }

    .dashboard-user-info {
        gap: 10px;
    }

    /* Hide desktop language dropdown on small mobile */
    .desktop-language {
        display: none !important;
    }

    /* Show mobile language toggle on small mobile */
    .mobile-language {
        display: inline !important;
    }

    .flag-toggle-btn {
        padding: 6px 8px;
    }

    .flag-icon {
        font-size: 20px;
    }

    /* Hide logout text on small mobile */
    .logout-btn .logout-text {
        display: none;
    }

    .logout-btn {
        padding: 6px 10px !important;
    }

    .logout-btn .logout-icon {
        width: 14px;
        height: 14px;
        margin-right: 0 !important;
    }
}

/* Light theme overrides for language/flag button */
[data-theme="light"] .flag-toggle-btn {
    background: white !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    color: #1a1a1a !important;
}

[data-theme="light"] .flag-toggle-btn:hover {
    background: rgba(240, 240, 240, 1) !important;
    border-color: rgba(0, 0, 0, 0.3) !important;
}
