body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', sans-serif;
    background-color: #0B132B;
    color: white;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/*LOGIN*/
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0B132B;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: #1C2541;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(111, 255, 233, 0.3);
    text-align: center;
    width: 100%;
    max-width: 350px;
    border: 1px solid #3A506B;
}

.login-input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background: #0B132B;
    border: 1px solid #3A506B;
    color: white;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
}

.login-input:focus {
    border-color: #6FFFE9;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: #6FFFE9;
    color: #0B132B;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 18px;
    margin-top: 20px;
    transition: transform 0.1s;
}

.login-btn:active {
    transform: scale(0.98);
}

.error-msg {
    color: #EF476F;
    display: none;
    margin-top: 15px;
    font-weight: bold;
}

/*LAYOUT*/
#app-container {
    display: none;
    width: 100%;
    height: 100%;
}

.app-layout {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

/*SIDEBAR*/
.sidebar {
    width: 260px;
    background-color: #1C2541;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-right: 1px solid #3A506B;
    height: 100%;
    flex-shrink: 0;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1300;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #6FFFE9;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 10px;
    font-size: 30px;
}

.lang-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.lang-btn {
    background: #0B132B;
    border: 1px solid #3A506B;
    color: #ccc;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    width: 50%;
    font-size: 14px;
}

.lang-btn.active {
    background: #6FFFE9;
    color: #0B132B;
    font-weight: bold;
}

.menu-item {
    padding: 12px 15px;
    color: #8D99AE;
    cursor: pointer;
    transition: 0.2s;
    border-radius: 10px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 15px;
}

.menu-item:hover,
.menu-item.active {
    background-color: #3A506B;
    color: #6FFFE9;
}

.menu-item i {
    width: 25px;
    text-align: center;
    margin-right: 10px;
}

/* MOBILE MENU*/
.mobile-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1200;
    font-size: 24px;
    color: #6FFFE9;
    background: #1C2541;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #3A506B;
    cursor: pointer;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1250;
}

/*CONTENT*/
.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    background-color: #0B132B;
    position: relative;
    width: 100%;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #1C2541;
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid #3A506B;
}

.stats-row {
    display: flex;
    gap: 25px;
    margin-bottom: 25px;
}

.stat-box {
    background-color: #1C2541;
    flex: 1;
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #3A506B;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.stat-label {
    font-size: 14px;
    color: #8D99AE;
}

/*DASHBOARD*/
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 25px;
}

.item-map {
    grid-column: 1;
    grid-row: 1;
}

.item-spotify {
    grid-column: 1;
    grid-row: 2;
}

.item-history {
    grid-column: 2;
    grid-row: 1;
}

.item-docs {
    grid-column: 2;
    grid-row: 2;
}

.card {
    background-color: #1C2541;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid #3A506B;
    height: 100%;
}

.card-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: #6FFFE9;
    font-weight: 600;
    border-bottom: 1px solid #3A506B;
    padding-bottom: 10px;
}

.fixed-height-card {
    min-height: 240px;
    display: flex;
    flex-direction: column;
}

.spotify-dashboard-card {
    background: linear-gradient(135deg, #1DB954 0%, #101010 100%);
    border: 1px solid #1aa34a;
    color: white;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    text-align: center;
}


.map-card-visual {
    height: 250px;
    position: relative;
    border-radius: 20px;
    border: 2px solid #3A506B;
    overflow: hidden;
    margin-bottom: 0;
    cursor: pointer;
    background: url('https://upload.wikimedia.org/wikipedia/commons/e/ec/World_map_blank_without_borders.svg') no-repeat center center;
    background-size: cover;
    background-color: #242f3e;
    width: 100%;
}

.map-overlay-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(28, 37, 65, 0.95);
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid #6FFFE9;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.dash-spotify {
    padding: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    background: #1DB954;
    color: white;
    border-radius: 20px;
    border: 1px solid #1aa34a;
    margin-top: 0;
}

/*MAP PAGE */
#map-full-container {
    height: 75vh;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 2px solid #3A506B;
}

#map-full {
    height: 100%;
    width: 100%;
}

/*Map Controls*/
.map-search-box {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 999;
    display: flex;
    gap: 5px;
    background: rgba(28, 37, 65, 0.9);
    padding: 8px;
    border-radius: 10px;
    border: 1px solid #3A506B;
    max-width: 80%;
}

.map-search-input {
    background: #0B132B;
    border: 1px solid #555;
    color: white;
    padding: 8px;
    border-radius: 5px;
    width: 200px;
    outline: none;
}

.map-controls-right {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    transition: all 0.3s ease;
}

.map-car-select {
    background: #6FFFE9;
    color: #0B132B;
    font-weight: bold;
    padding: 10px;
    border-radius: 8px;
    border: none;
    outline: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    min-width: 120px;
}

.map-btn {
    background: #1C2541;
    color: #6FFFE9;
    border: 1px solid #6FFFE9;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}


/* --- MOBILE MEDIA QUERY --- */
@media (max-width: 900px) {
    .login-box {
        margin: auto !important;
        width: 90% !important;
        max-width: 350px !important;
        transform: translateY(-27%);
        position: relative !important;
        z-index: 2147483648 !important; 
        pointer-events: auto !important; 
    }
    
 
    .mobile-toggle {
        display: block;
    }

 /*СТРАНИЧНО МЕНЮ*/
    .sidebar {
        display: block !important;
        
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100% !important;
        background: #1C2541;
        z-index: 10000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.5);
        padding: 20px !important;
        padding-bottom: 100px !important; 
        overflow-y: auto !important;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /*БУТОН ИЗХОД*/
    .sidebar .logout-btn {
        display: block !important;
        
        position: absolute !important;
        bottom: 30px !important;       
        left: 20px !important;         
        right: 20px !important;        
        width: auto !important;        
        margin: 0 !important;      
        background: rgba(255, 0, 0, 0.2);
        color: white;
        text-align: center;
        padding: 15px;
        border-radius: 10px;
        z-index: 10001;
    }

    /*Заглавие-мобилна версия*/
    .sidebar .logo {
        padding-left: 50px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-overlay.open {
        display: block;
    }

    .main-content {
        padding: 100px 15px 300px 15px;
    }

    .header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: rgba(11, 19, 43, 0.95);
        padding: 15px 15px 15px 70px;
        z-index: 1100;
        border-bottom: 1px solid #3A506B;
        margin: 0;
        backdrop-filter: blur(5px);
    }

    .stats-row {
        flex-direction: column;
        gap: 15px;
    }

    /*DASHBOARD GRID*/
    .dashboard-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
    }

    .item-map {
        width: 100%;
        order: 1;
    }

    .item-history {
        width: calc(50% - 7.5px);
        order: 2;
        height: auto;
    }

    .item-docs {
        width: calc(50% - 7.5px);
        order: 2;
        height: auto;
    }

    .item-spotify {
        width: 100%;
        order: 3;
    }

    .card {
        padding: 15px;
        font-size: 13px;
    }

    .card-title {
        font-size: 15px;
        margin-bottom: 10px;
    }

    #dashboard-history {
        max-height: 100px;
    }

    .fixed-height-card {
        min-height: 180px;
    }

    #map-full-container {
        height: 65vh;
    }

    .map-search-input {
        width: 140px;
        font-size: 14px;
    }

    .map-controls-right {
        right: auto;
        left: 10px;
        top: 75px;
        align-items: flex-start;
    }

    .map-btn i.fa-crosshairs {
        font-size: 14px;
    }
}

/*Лента за напомняне за изтичащи документи*/
#urgent-alert-box {
    display: none;
    background-color: rgba(239, 71, 111, 0.2);
    border: 2px solid #EF476F;
    color: #EF476F;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 71, 111, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 71, 111, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 71, 111, 0);
    }
}

.page {
    display: none;
    animation: fadeIn 0.4s;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*Икони-карта*/
.custom-div-icon {
    background: transparent;
    border: none;
}

.marker-pin {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    background: #3A506B;
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-pin i {
    transform: rotate(45deg);
    color: white;
    font-size: 14px;
}

.pin-parking {
    background: #304a7d;
    border-color: #6FFFE9;
}

.pin-ev {
    background: #1DB954;
    border-color: white;
}

/*YOUTUBE*/
.yt-search-bar {
    display: flex;
    gap: 10px;
    background: #1C2541;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 1px solid #3A506B;
    flex-wrap: wrap;
}

.yt-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}

.yt-cat-pill {
    background: #3A506B;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.yt-cat-pill.active {
    background: #FF0000;
    color: white;
}

.yt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 500px) {
    .yt-grid {
        grid-template-columns: 1fr;
    }
}

.yt-card {
    background: #1C2541;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.yt-thumb {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.yt-info {
    padding: 15px;
}

/*SPOTIFY PAGE*/
.spotify-modern {
    background: linear-gradient(180deg, #1DB954 0%, #101010 100%);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    border: 1px solid #333;
}

.sp-art {
    width: 120px;
    height: 120px;
    background: #333;
    margin: 0 auto 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.sp-track-item {
    padding: 12px;
    cursor: pointer;
    color: #ccc;
    border-bottom: 1px solid #333;
    text-align: left;
}

label {
    display: block;
    color: #ccc;
    margin-top: 15px;
    font-size: 14px;
}

input[type="date"],
input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 12px;
    background: #0B132B;
    border: 1px solid #555;
    color: white;
    border-radius: 8px;
    margin-top: 5px;
    outline: none;
}

.full-width-form {
    width: 100%;
    max-width: 100% !important;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.input-error {
    border: 2px solid #EF476F !important;
    background-color: rgba(239, 71, 111, 0.1) !important;
}

.status-ok {
    color: #6FFFE9;
}

.status-warning {
    color: #FFD166;
}

.status-danger {
    color: #EF476F;
}

/*CONTACTS*/
.reward-card {
    background: linear-gradient(135deg, #FFD166, #ff9f43);
    color: #0B132B;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 600px) {
    .reward-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.btn-claim {
    background: #0B132B;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    align-self: flex-start;
}

.contact-card {
    background: #1C2541;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #3A506B;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: #3A506B;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #6FFFE9;
    flex-shrink: 0;
}

/*Модул-плащане*/
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 5000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-box {
    background: #1C2541;
    padding: 25px;
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    border: 2px solid #6FFFE9;
    box-shadow: 0 0 40px rgba(111, 255, 233, 0.1);
    position: relative;
    overflow-y: auto;
    max-height: 90vh;
}

.credit-card {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cc-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: #fff;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-family: monospace;
    letter-spacing: 2px;
}

.reserved-msg {
    background: rgba(255, 209, 102, 0.15);
    color: #FFD166;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    border: 1px solid #FFD166;
    margin-bottom: 15px;
}


@media (max-width: 900px) {
    .modal-overlay {
        display: none;
        align-items: flex-start !important; 
        padding: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        z-index: 99999 !important;
    }

    .modal-overlay.open,
    .modal-overlay[style*="display: flex"] {
        display: flex !important;
    }

    .modal-box {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        
        width: 90% !important;
        max-width: 400px !important;
        height: 65% !important;
        max-height: none !important;
        
        margin: 40px auto 100px auto !important;
        padding: 20px !important;
    }

    .credit-card {
        padding: 15px !important;
        margin: 15px 0 !important;
    }

    .cc-input {
        font-size: 16px !important; 
        padding: 12px !important;
        height: 45px !important;
        margin-bottom: 10px !important;
    }
}


/*AI БУТОН*/
#ai-assistant-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6FFFE9, #5BC0BE);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(111, 255, 233, 0.4);
    cursor: pointer;
    z-index: 10000;
    transition: transform 0.3s ease;
}

#ai-assistant-btn i {
    font-size: 28px;
    color: #0B132B;
}

#ai-assistant-btn:hover {
    transform: scale(1.1) rotate(10deg);
}

#ai-assistant-btn:active {
    transform: scale(0.9);
}

/*ТРИЪГЪЛНИК-известие за изтичащи документи)*/
.header-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-right: 15px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.header-btn i {
    font-size: 20px;
    color: #8D99AE;
}

.header-btn.urgent {
    background-color: #3d1a1a !important;   
    border: 2px solid #FF0000 !important;  
    animation: panicPulse 1s infinite;      
}

.header-btn.urgent i {
    color: #FFD166 !important; 
}

.badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #FF0000;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid white;
}

@keyframes panicPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(255,0,0,0.5); }
    50% { transform: scale(1.1); box-shadow: 0 0 15px rgba(255,0,0,0.8); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(255,0,0,0.5); }
}

/*Бутон-Плати документи*/
.docs-header-row {
    display: flex;
    justify-content: space-between; 
    align-items: center;          
    margin-bottom: 20px;
    gap: 10px;                   
    width: 100%;
}


.docs-header-row h3 {
    margin: 0;
    color: #6FFFE9;
    flex: 1; 
    font-size: 1.17em; 
}

.btn-pay-header {
    width: auto !important;
    margin-top: 0 !important;
    background-color: #6FFFE9;
    white-space: pre-line;
    text-align: center;     
    line-height: 1.1;      
    padding: 10px 15px;  
    white-space: nowrap;
    font-size: 16px;        
    min-width: fit-content;
    height: auto;          
}

@media (max-width: 600px) {
    .docs-header-row h3 {
        font-size: 16px;
    }

    .btn-pay-header {
        font-size: 14px;   
        padding: 6px 8px;
    }
}

@media (max-width: 900px) {
    #ai-assistant-btn {
        position: fixed !important; 
        right: 10px !important;
        bottom: 280px !important;
        display: flex !important;
        z-index: 99000 !important;
        width: 60px !important;
        height: 60px !important;
    }
}