* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif; }

html, body {
    background-color: #030303; /* Previne apariția spațiilor albe la scroll/safari */
    color: white;
    width: 100%;
    height: 100%;
    overscroll-behavior-y: none; /* Elimină 'bounce' effect-ul pe iOS care arată fundalul alb */
}

/* Noul Fundal: Negru profund cu lumini albe subtile în mișcare */
.fundal-water { 
    width: 100vw; 
    min-height: 100vh;
    min-height: 100dvh;
    background: #030303; /* Negru intens */
    background-image: 
        linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%,rgba(94, 35, 231, 0.189)50%, transparent 85%),
        radial-gradient(circle at 90% 0%, rgba(255, 255, 255, 0.28) 0%, transparent 50%);
    background-size: 250% 250%; 
    background-attachment: fixed;
    animation: miscareLuminaDapta 10s ease infinite alternate; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
    overflow-x: hidden;
    overflow-y: auto;
}

@keyframes miscareLuminaDapta { 
    0% { background-position: 100% 0%; } 
    50% { background-position: 75% 50%; } 
    100% { background-position: 95% 100%; } 
}

@keyframes miscareLumini { 
    0% { background-position: 0% 50%; } 
    50% { background-position: 100% 50%; } 
    100% { background-position: 0% 50%; } 
}

.buton-top-cont { position: absolute; top: 30px; left: 40px; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 30px; padding: 12px 22px; color: white; font-size: 16px; font-weight: bold; cursor: pointer; transition: 0.3s; display: flex; align-items: center; gap: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.buton-top-cont:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-2px); border-color: rgba(255,255,255,0.4); }

.grila-sporturi { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 20px; z-index: 10; width: 100%; max-width: 800px; }
.card-sport { background: rgba(255, 255, 255, 0.07); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 25px; padding: 40px 60px; text-align: center; cursor: pointer; transition: all 0.4s ease; color: white; box-shadow: 0 10px 30px rgba(0,0,0,0.3); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.iconita-minge { width: 100px; height: 100px; object-fit: contain; margin-bottom: 20px; transition: transform 0.4s ease; filter: drop-shadow(0 4px 10px rgba(255,255,255,0.2)); }
.card-sport:hover { transform: scale(1.05) translateY(-5px); box-shadow: 0 15px 40px rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.12); border-color: rgba(255,255,255,0.3); }
.card-sport:hover .iconita-minge { transform: scale(1.15) rotate(10deg); }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(12px); z-index: 100; align-items: center; justify-content: center; }
.modal.activ { display: flex; }
.modal-continut { background: rgba(20, 20, 20, 0.65); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 30px; padding: 30px; width: 90%; max-width: 450px; color: white; position: relative; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.8); }
.modal-mare { max-width: 600px; }
.titlu-modal { text-align: center; margin-bottom: 25px; font-weight: 600; font-size: 24px;}
.subtitlu-modal { margin: 20px 0 10px 0; font-size: 16px; opacity: 0.9; }

.buton-inchidere { position: absolute; top: 20px; right: 25px; background: none; border: none; color: white; font-size: 22px; cursor: pointer; font-weight: bold; opacity: 0.7; transition: 0.3s; }
.buton-inchidere:hover { opacity: 1; }

.buton-inapoi { 
    position: absolute; 
    top: 22px; 
    left: 20px; 
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    color: white; 
    font-size: 11px; 
    font-weight: bold; 
    padding: 5px 10px; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.3s; 
}
.buton-inapoi:hover { background: rgba(255, 255, 255, 0.25); }

.taburi-auth { display: flex; gap: 10px; margin-bottom: 25px; background: rgba(255, 255, 255, 0.05); padding: 5px; border-radius: 15px; border: 1px solid rgba(255,255,255,0.1); }
.tab-auth { flex: 1; background: none; border: none; color: white; padding: 12px; border-radius: 12px; font-size: 15px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.tab-auth.activ { background: white; color: #000; }
.formular-auth { display: flex; flex-direction: column; gap: 15px; }
.grup-input { display: flex; flex-direction: column; gap: 6px; }
.grup-input label { font-size: 14px; opacity: 0.9; }
.grup-input input { background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.2); padding: 14px; border-radius: 12px; color: white; font-size: 16px; outline: none; }
.grup-input input:focus { border-color: rgba(255,255,255,0.6); }
.grup-input input::placeholder { color: rgba(255, 255, 255, 0.4); }

.profil-header { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
.avatar-mare { font-size: 40px; background: rgba(255, 255, 255, 0.1); width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); margin-bottom: 10px; }
.detalii-utilizator { margin-bottom: 20px; }
.detalii-utilizator p { background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255,255,255,0.1); padding: 12px 15px; border-radius: 12px; margin-bottom: 10px; font-size: 15px; }
.actiuni-cont { display: flex; flex-direction: column; gap: 12px; }
.btn-cont { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 12px; border-radius: 15px; font-size: 15px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-cont:hover { background: white; color: black; }
.btn-deconectare { background: rgba(255, 59, 48, 0.2); border: 1px solid rgba(255, 59, 48, 0.4); color: #ff8a80; padding: 12px; border-radius: 15px; font-size: 15px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-deconectare:hover { background: rgba(255, 59, 48, 0.5); color: white; }

.container-rezervari { display: flex; flex-direction: column; gap: 15px; margin-top: 10px; }
.card-rezervare-item { background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255,255,255,0.1); padding: 15px; border-radius: 15px; border-left: 4px solid #34c759; display: flex; flex-direction: column; }
.card-rezervare-item.istoric { border-left-color: #777; opacity: 0.7; }
.card-rezervare-item h4 { font-size: 16px; margin-bottom: 5px; }
.card-rezervare-item p { font-size: 13px; opacity: 0.8; margin-bottom: 3px; }

.btn-anulare { background: rgba(255, 59, 48, 0.2); border: 1px solid rgba(255, 59, 48, 0.4); color: #ff8a80; padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-anulare:hover { background: rgba(255, 59, 48, 0.6); color: white; }
.btn-harta-activa { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-harta-activa:hover { background: rgba(255, 255, 255, 0.25); }
.grup-butoane-card { display: flex; gap: 10px; margin-top: 10px; }

.grila-terenuri { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.card-teren-poza { background: rgba(0, 0, 0, 0.4); border-radius: 20px; overflow: hidden; cursor: pointer; transition: 0.3s; border: 1px solid rgba(255,255,255,0.1); }
.card-teren-poza:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.4); }
.card-teren-poza img { width: 100%; height: 120px; object-fit: cover; }
.info-teren-poza { padding: 15px; text-align: center; }
.info-teren-poza h3 { font-size: 16px; margin-bottom: 5px; }
.info-teren-poza p { font-size: 14px; color: #a1eafb; font-weight: bold; }

.grila-zile { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.grila-ore { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pastila-zi, .pastila-ora { background: rgba(255, 255, 255, 0.05); padding: 10px 15px; border-radius: 12px; text-align: center; cursor: pointer; transition: 0.3s; border: 1px solid rgba(255,255,255,0.1); }
.pastila-zi { min-width: 80px; }
.pastila-ora { width: calc(25% - 10px); padding: 10px 0; }
.pastila-zi span { font-size: 12px; opacity: 0.6; }
.pastila-zi:hover, .pastila-ora:hover { background: rgba(255, 255, 255, 0.15); }
.pastila-zi.activa, .pastila-ora.activa { background: white; color: black; font-weight: bold; }

.zona-butoane-finale { display: flex; flex-direction: column; gap: 12px; margin-top: 25px; }
.disclaimer-anulare { font-size: 13px; color: #ffcccc; background: rgba(255, 59, 48, 0.15); padding: 12px; border-radius: 12px; text-align: center; border: 1px solid rgba(255, 59, 48, 0.3); line-height: 1.4; }
.cum-anulez { margin-top: 8px; font-size: 12px; color: white; }
.cum-anulez summary { cursor: pointer; opacity: 0.7; text-decoration: underline; font-weight: bold; outline: none; transition: 0.3s; }
.cum-anulez summary:hover { opacity: 1; }
.pasi-anulare { margin-top: 8px; background: rgba(0, 0, 0, 0.5); padding: 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); line-height: 1.8; font-size: 13px; color: #ccc; text-align: left; }

.buton-locatie { background: rgba(255, 255, 255, 0.1); color: white; border: 1px solid rgba(255,255,255,0.2); padding: 15px; border-radius: 15px; font-size: 16px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.buton-locatie:hover { background: rgba(255, 255, 255, 0.2); }
.buton-rezervare { background: white; color: black; border: none; padding: 15px; border-radius: 15px; font-size: 18px; font-weight: bold; cursor: pointer; transition: 0.3s; box-shadow: 0 4px 20px rgba(255,255,255,0.2); width: 100%; }
.buton-rezervare:hover { background: #e0e0e0; transform: scale(1.02); }
.buton-rezervare:disabled { background: #333; color: #666; cursor: not-allowed; transform: none; box-shadow: none; }

.optiune-minge { display: flex; justify-content: space-between; align-items: center; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255,255,255,0.1); padding: 15px; border-radius: 15px; margin-bottom: 20px;}
.switch-apple { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch-apple input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.2); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #34c759; }
input:checked + .slider:before { transform: translateX(22px); }

@media (max-width: 600px) { 
    .buton-top-cont { top: 15px; left: 15px; padding: 10px 16px; font-size: 14px; } 
    
    /* Corectare layout pentru cardurile de sport pe mobil */
    .grila-sporturi { 
        gap: 15px; 
        padding: 15px; 
        width: 100%; 
        max-width: 100%; 
        margin-top: 60px; /* Ca să nu se suprapună cu butonul de cont/limbă pe ecrane foarte mici */
    }
    .card-sport { 
        padding: 20px 10px; 
        border-radius: 20px; 
        aspect-ratio: 1 / 1; /* Le face pătrate perfecte */
        display: flex; 
        flex-direction: column; 
        justify-content: center; 
        align-items: center; 
    }
    .iconita-minge { 
        width: 60px; 
        height: 60px; 
        margin-bottom: 10px; 
    }
    .card-sport h2 { 
        font-size: 16px; 
    }

    /* Asigură-te că fereastra modală are padding bun pe mobil */
    .modal-continut { padding: 20px; border-radius: 20px; }
}

/* Corectare aliniere Zile și Ore în fereastra de rezervare */
#container-zile {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-top: 10px;
    padding-bottom: 5px;
}

.btn-zi {
    flex: 1;
    min-width: 50px;
    padding: 8px 4px;
    font-size: 12px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
}

.btn-zi.selectat {
    background: #22c55e !important;
    border-color: #22c55e;
    font-weight: bold;
}

#container-ore {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.btn-ora {
    padding: 10px;
    font-size: 14px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
}

.btn-ora.selectat {
    background: #22c55e !important;
    border-color: #22c55e;
    font-weight: bold;
}

.btn-ora.ocupat {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
    cursor: not-allowed;
    text-decoration: line-through;
}
/*coloarea calendar data-inchidere zile*/
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* =========================================
   STILURI CHAT (CLIENT + ADMIN)
========================================= */

/* Prevent scroll on body */
.fara-scroll { overflow: hidden !important; }

/* Bulina de Notificare (Chat General) */
.bulina-notificare {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    padding: 3px 6px;
    min-width: 18px;
    text-align: center;
    border: 2px solid #030303;
    animation: puls 1.5s infinite;
}

@keyframes puls {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239,68,68, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(239,68,68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239,68,68, 0); }
}

/* Modal specific de Chat */
.modal-chat-box {
    display: flex;
    flex-direction: column;
    height: 70vh; /* Păstrăm fix pentru a avea scroll pe lista de mesaje */
    max-height: 80vh;
}

.chat-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Lista de Mesaje (Areal de Scroll) */
.lista-mesaje {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}

.lista-mesaje::-webkit-scrollbar { width: 6px; }
.lista-mesaje::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 4px; }
.lista-mesaje::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Bula Mesaj */
.mesaj-bula {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    word-break: break-word;
}

/* Mesajul Trimis de mine */
.mesaj-trimis {
    align-self: flex-end;
    background: #005c4b; /* Culoare specifică WhatsApp Dark Mode pentru mesaje trimise */
    border-bottom-right-radius: 4px;
}

/* Mesajul Primit */
.mesaj-primit {
    align-self: flex-start;
    background: #202c33; /* Culoare specifică WhatsApp Dark Mode pentru mesaje primite */
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}

.mesaj-timestamp {
    display: block;
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    text-align: right;
    margin-top: 5px;
}

.bife-citit {
    margin-left: 5px;
    font-size: 11px;
}
.bife-albastre {
    color: #34b7f1; /* WhatsApp blue ticks */
}
.bife-gri {
    color: #9ca3af;
}

/* Zona de Input Chat */
.chat-input-zona {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.chat-input-zona input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 12px 15px;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    outline: none;
}
.chat-input-zona input:focus { border-color: #3b82f6; }
.chat-input-zona input:disabled { background: rgba(0,0,0,0.5); cursor: not-allowed; opacity: 0.6; border-color: #ef4444; }

.chat-btn-trimite {
    background: #3b82f6;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}
.chat-btn-trimite:hover { background: #2563eb; transform: scale(1.05); }
.chat-btn-trimite:disabled { background: #555; cursor: not-allowed; transform: none; }

/* Item Conversație (Admin sau Master-list Client) */
.card-conversatie {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
}
.card-conversatie:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }

/* Stilizare specială când conversația are mesaje necitite (albastru accentuat) */
.card-conversatie.necitit {
    background: rgba(59, 130, 246, 0.15); /* Albastru subtil */
    border-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.card-conversatie.necitit::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #3b82f6;
    border-radius: 50%;
    box-shadow: 0 0 5px #3b82f6;
}

.card-conversatie h4 { font-size: 15px; margin-bottom: 5px; color: white; }
.card-conversatie p { font-size: 13px; color: #ccc; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Z-index fix for language selector when modals are open */
body.fara-scroll #selector-limba {
    display: none !important;
}

body.fara-scroll {
    overflow: hidden !important;
    touch-action: none;
}
.modal {
    overscroll-behavior: contain;
}
.modal-continut {
    touch-action: auto;
}

/* Layout Master-Detail (Instagram Style) */
.modal-chat-box {
    width: 100%;
    max-width: 400px !important; /* Starts narrow (List only) */
    transition: max-width 0.3s ease;
}

.modal-chat-box.conversatie-activa {
    max-width: 800px !important; /* Expands when chat is open */
}

.container-dual-chat {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 15px;
    height: 60vh;
}

/* Stare inițială (Doar lista) */
.lista-conversații-side {
    width: 100%;
    border-right: none;
    padding-right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.fereastra-mesaje-side {
    display: none; /* Ascuns implicit */
    flex-direction: column;
    flex: 1;
}

/* Stare activă (Conversație deschisă pe Desktop) */
.modal-chat-box.conversatie-activa .lista-conversații-side {
    width: 35%;
    border-right: 1px solid rgba(255,255,255,0.1);
    padding-right: 10px;
}
.modal-chat-box.conversatie-activa .fereastra-mesaje-side {
    display: flex;
}

.btn-inchide-conversatie-mobile {
    display: block; /* Vizibil mereu pentru a închide fereastra din dreapta */
}

/* Modificare pt Mobil */
@media (max-width: 768px) {
    .container-dual-chat { flex-direction: column; }
    
    .modal-chat-box.conversatie-activa .lista-conversații-side { 
        display: none; /* Ascunde lista pe mobil cand esti in chat */
    }
    
    .modal-chat-box.conversatie-activa .fereastra-mesaje-side { 
        width: 100%;
        height: 100%;
    }
}
