/* =========================================
   GERMAN DATING APP DESIGN SYSTEM
   Target: DACH Market (Serious, Modern, Clean)
   ========================================= */

:root {
    /* Tinder-like Primary Color */
    --primary: #ff4b2b;
    --primary-gradient: linear-gradient(to right, #ff416c, #ff4b2b);
    --primary-dark: #e04022;
    
    /* Neutral Colors */
    --text-main: #2d3436;
    --text-light: #636e72;
    --bg-body: #f3f4f6;
    --white: #ffffff;
    --border: #dfe6e9;
    
    /* Status Colors */
    --online: #00b894;
    --verified: #0984e3;
    
    /* Effects */
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-float: 0 10px 25px rgba(255, 75, 43, 0.4);
    --radius-card: 16px;
    --radius-btn: 50px;
}

/* === RESET & BASE === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    padding-bottom: 90px; /* Spatiu pentru butonul sticky */
    -webkit-font-smoothing: antialiased;
}

/* === HEADER (App Style) === */
.header {
    background: var(--white);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logo span {
    color: var(--text-main);
}

.header-btn {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    border: 1.5px solid var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    transition: all 0.2s;
}

.header-btn:hover {
    background: var(--primary);
    color: var(--white);
}

/* === SUBHEADER & SEARCH === */
.subheader {
    background: var(--white);
    padding: 20px 20px 30px;
    text-align: center;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    margin-bottom: 20px;
}

.subheader h2 {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.3;
}

.subheader p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Search Bar Pill */
.search-bar {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-bar input {
    width: 100%;
    padding: 14px 20px;
    padding-right: 50px;
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 15px;
    background: #f9f9f9;
    transition: all 0.2s;
}

.search-bar input:focus {
    background: var(--white);
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 75, 43, 0.1);
}

.search-bar button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: var(--white);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.2s;
}

.search-bar button:active {
    transform: translateY(-50%) scale(0.9);
}

/* === GRID LAYOUT === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

.grid {
    display: grid;
    /* Auto-fit inteligent: 2 coloane pe mobil, mai multe pe desktop */
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 12px;
}

/* === PROFILE CARD === */
.card {
    background: var(--white);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    touch-action: manipulation;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* Aspect Ratio 3:4 (Portrait) */
.card-img, .video-wrap {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
    background: #e0e0e0;
}

.video-wrap {
    position: relative;
    overflow: hidden;
}

.video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Play Button Overlay */
.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    backdrop-filter: blur(4px);
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.6);
}

/* Online Badge (Floating) */
.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-main);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 2;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--online);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Card Info Area */
.card-info {
    padding: 12px;
}

.card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.verified {
    color: var(--verified);
    font-size: 14px;
}

.card-meta {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === STICKY CTA BUTTON === */
.sticky-cta {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-gradient);
    color: var(--white);
    text-decoration: none;
    padding: 16px 30px;
    border-radius: var(--radius-btn);
    font-weight: 700;
    font-size: 16px;
    box-shadow: var(--shadow-float);
    z-index: 200;
    width: 90%;
    max-width: 400px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s;
    letter-spacing: 0.5px;
}

.sticky-cta:active {
    transform: translateX(-50%) scale(0.96);
}

.sticky-cta span {
    font-size: 18px;
}

/* === MODAL PROFILE (Full Screen Overlay) === */
.modal-overlay {
    display: none; /* Hidden by default */
}

/* În server.js, modalul este randat direct în body pe pagina /slug, 
   așa că stilizăm direct .modal și .modal-close */

/* Aceasta este pagina de profil */
.modal {
    background: var(--white);
    width: 100%;
    max-width: 450px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    margin: 20px; /* Spatiu pe desktop */
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    font-size: 20px;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.modal-img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    background: #000;
    display: block;
}

.modal-content {
    padding: 25px;
}

.modal-name {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
}

.modal-loc {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-bio {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.btn-chat {
    display: block;
    width: 100%;
    background: var(--primary-gradient);
    color: var(--white);
    text-align: center;
    padding: 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 17px;
    box-shadow: 0 4px 15px rgba(255, 75, 43, 0.3);
    transition: transform 0.2s;
}

.btn-chat:hover {
    transform: translateY(-2px);
}

/* === FOOTER === */
footer a {
    text-decoration: none;
    transition: color 0.2s;
}
footer a:hover {
    color: var(--primary);
}

/* === ANIMATIONS === */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(0, 184, 148, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 184, 148, 0);
    }
}

/* === MOBILE OPTIMIZATIONS === */
@media (min-width: 768px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    .sticky-cta {
        bottom: 30px;
    }
    /* Centrare modal pe desktop */
    body.profile-page-body {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        background: #000;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
    .grid {
        gap: 8px;
    }
    .subheader h2 {
        font-size: 18px;
    }
    .modal-img {
        height: 400px;
    }
}