:root {
    --neon-pink: #ff007f;
    --neon-lavender: #b57edc;
    --light-bg: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --text-main: #222222;
}

body {
    background-color: var(--light-bg);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 0, 127, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(181, 126, 220, 0.05) 0%, transparent 40%);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    position: relative;
}

/* Background Hearts */
.heart-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-heart {
    position: absolute;
    color: var(--neon-pink);
    opacity: 0.2;
    font-size: 1.5rem;
    animation: float 6s infinite linear;
}

@keyframes float {
    0% { transform: translateY(110vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* --- MAIN CARD STYLES --- */
.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 0, 127, 0.1);
    border-radius: 30px;
    padding: 40px;
    width: 100%;
    max-width: 380px; /* Initial small size */
    height: auto;
    max-height: 600px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    text-align: center;
    position: relative;
    z-index: 10;
    overflow: hidden;
    transition: all 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

/* --- EXPANDED STATE --- */
/* --- EXPANDED CARD (The Outer Box) --- */
.auth-card.expanded {
    max-width: 800px;
    width: 90vw;
    /* Fixed height relative to viewport. This stops the card from growing forever. */
    height: 85vh;
    max-height: unset;

    /* Flex Setup */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Important: cuts off anything sticking out */
}

/* --- THE FORM (The Middleman) --- */
#mainForm {
    /* Must fill the card exactly */
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevents form from pushing card boundaries */
}

/* --- STAGE 2 CONTAINER (The Content Wrapper) --- */
#stage2_content {
    /* Must fill the form exactly */
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- THE SCROLL AREA (The Questions) --- */
.scroll-container {
    /* Flex magic: Take up all REMAINING space */
    flex: 1;

    /* Force scrollbar if content is too big */
    overflow-y: auto;

    /* Styling */
    text-align: left;
    padding: 0 15px;
    margin-top: 10px;
    margin-bottom: 10px;

    /* Initial state logic */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Ensure the button stays at the bottom and doesn't shrink */
#toStage3Btn {
    flex-shrink: 0;
    margin-bottom: 20px;
}


/* Input Styles */
.question-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.question-item label {
    display: block;
    font-weight: bold;
    color: var(--neon-pink);
    margin-bottom: 8px;
}
input, select, textarea {
    width: 100%;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
    box-sizing: border-box;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--neon-pink);
    background: #fff;
}
.select-wrapper { position: relative; }
.select-wrapper::after {
    content: '▼';
    font-size: 0.8rem;
    color: var(--neon-pink);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Buttons and Logos */
.logo { font-size: 2.2rem; font-weight: 900; margin-bottom: 30px; }
.logo .neon { color: var(--neon-pink); }
.logo .date { color: var(--neon-lavender); }

.btn-glow {
    width: 100%;
    padding: 16px;
    border-radius: 50px;
    border: none;
    background: var(--neon-pink);
    color: #fff;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(255, 0, 127, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
}
.btn-glow:hover { background: var(--neon-lavender); transform: translateY(-2px); }

.hidden { display: none !important; }

@media (max-width: 768px) {
    .auth-card.expanded {
        width: 95vw;
        height: 92vh;
    }
}

/* ... Keep all previous CSS ... */

/* STAGE 3: File Upload Styling */
.file-upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--neon-lavender);
    border-radius: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: 0.3s;
    color: var(--neon-pink);
    font-weight: bold;
}

.file-upload-box:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.1);
}

/* --- STAGE 3 LAYOUT FIX --- */
#stage3_content {
    /* Make it fill the card */
    height: 100%;
    display: flex;
    flex-direction: column;

    /* ENABLE SCROLLING */
    overflow-y: auto;
    justify-content: flex-start; /* Start from top, don't center */

    /* Add padding so it doesn't touch edges */
    padding: 20px 15px;

    /* Animation */
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Reuse the nice scrollbar from Stage 2 */
#stage3_content::-webkit-scrollbar { width: 6px; }
#stage3_content::-webkit-scrollbar-track { background: rgba(0,0,0,0.02); }
#stage3_content::-webkit-scrollbar-thumb { background: var(--neon-pink); border-radius: 10px;}

/* Ensure the buttons don't get squashed or cut off */
#stage3_content button[type="submit"] {
    flex-shrink: 0; /* Prevent shrinking */
    margin-top: 20px;
}

#backToStage2 {
    flex-shrink: 0;
    margin-top: 15px;
    margin-bottom: 20px; /* EXTRA SPACE AT BOTTOM */
    padding-bottom: 5px;
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
}



/* --- NEW ELEMENTS STYLING --- */

/* Top Left Login Link */
.top-left-link {
    position: absolute;
    top: 25px;
    left: 25px;
    color: var(--neon-lavender); /* Subtle color */
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    transition: 0.3s;
    z-index: 20; /* Ensure it sits above other elements */
    padding: 5px 10px;
    border-radius: 15px;
    background: rgba(255,255,255,0.5); /* Slight background for readability */
}

.top-left-link:hover {
    color: var(--neon-pink);
    transform: translateX(-3px); /* Little nudge animation */
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Registration Sub-Heading */
.reg-heading {
    margin-top: -20px; /* Pull it closer to the logo */
    margin-bottom: 25px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* MOBILE ADJUSTMENT */
@media (max-width: 768px) {
    .top-left-link {
        top: 15px;
        left: 15px;
        font-size: 0.75rem;
    }
}

/* --- DASHBOARD LAYOUT --- */
/* --- DASHBOARD LAYOUT FIX --- */
.dashboard-container {
    /* KEY FIX: Use fixed positioning to break out of body's flex centering */
    position: fixed;
    top: 0;
    left: 0;

    /* Ensure it fills the screen exactly */
    width: 100vw;
    height: 100vh;

    /* Standard Layout */
    display: flex;
    overflow: hidden;
    z-index: 10;

    /* Reset margins so it doesn't shift */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- SHARED GLASS STYLE --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 0, 127, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* --- SIDEBAR --- */
.sidebar {
    /* Use calc to ensure it fits perfectly with margins */
    height: calc(100vh - 40px); /* 100vh minus top/bottom margins */
    width: 350px;
    margin: 20px; /* Fixed pixel margin is safer than vh for alignment */

    border-radius: 30px;
    display: flex;
    flex-direction: column;
    padding: 25px;
    box-sizing: border-box;
    transition: 0.3s;

    /* Ensure it doesn't shrink if screen is small */
    flex-shrink: 0;
}

.user-mini-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 20px;
}
.avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--neon-pink);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Requests Section */
.section-title {
    color: var(--neon-lavender);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    background: rgba(255,255,255,0.5);
    border-radius: 20px;
    padding: 5px;
    margin-bottom: 20px;
}
.toggle-btn {
    flex: 1;
    border: none;
    background: none;
    padding: 8px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: 0.3s;
}
.toggle-btn.active {
    background: var(--neon-pink);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 0, 127, 0.2);
}

/* Request List */
.request-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.hidden-list { display: none; }

.request-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.4);
    padding: 10px;
    border-radius: 15px;
    transition: 0.2s;
}
.request-item:hover { background: rgba(255,255,255,0.8); }

.req-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #555;
}
.req-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.req-name { font-weight: bold; font-size: 0.9rem; }
.req-dept { font-size: 0.75rem; color: #777; }
.req-status { font-size: 0.75rem; color: var(--neon-pink); font-weight: bold; }

.req-actions { display: flex; gap: 5px; }
.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: 0.2s;
}
.accept { background: #d4edda; color: #155724; }
.reject { background: #f8d7da; color: #721c24; }
.chat { background: var(--neon-lavender); color: white; }
.btn-icon:hover { transform: scale(1.1); }

/* Sidebar Footer */
.sidebar-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
    text-align: center;
}
.logout-link {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
}
.logout-link:hover { color: var(--neon-pink); }

/* --- MAIN FEED --- */
.main-feed {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.top-bar {
    position: absolute;
    top: 30px;
    font-size: 1.5rem;
    font-weight: 900;
}

/* Card Stack */
/* --- CARD STACK CONTAINER --- */
.card-stack {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 600px;
    /* Center the content */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- THE CARDS --- */
.profile-card {
    /* ABSOLUTE POSITIONING IS KEY FOR STACKING */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 0, 127, 0.1);
    border-radius: 30px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);

    /* Animation settings */
    transition: transform 0.5s ease-in-out, opacity 0.5s;
    background: white; /* Ensure non-transparent background so we can't see card below */
}

/* --- EMPTY STATE MESSAGE (Behind the cards) --- */
.no-more-profiles {
    position: absolute;
    text-align: center;
    color: #888;
    z-index: -1; /* Behind everything */
}
.no-more-profiles h3 { margin-bottom: 5px; color: var(--neon-pink); }

/* --- ANIMATIONS FOR SWIPING --- */
.swipe-left {
    transform: translateX(-150%) rotate(-30deg) !important;
    opacity: 0;
    pointer-events: none;
}

.swipe-right {
    transform: translateX(150%) rotate(30deg) !important;
    opacity: 0;
    pointer-events: none;
}

.card-image-container {
    height: 65%;
    width: 100%;
    overflow: hidden;
    position: relative;
}
.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    backdrop-filter: blur(5px);
}

.card-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-header h2 { margin: 0; font-size: 1.5rem; display: flex; align-items: center; gap: 10px; }
.card-header .age { font-size: 1.2rem; font-weight: normal; color: #666; }
.dept-badge {
    background: var(--neon-lavender);
    color: white;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
}

.bio { color: #555; font-size: 0.95rem; margin: 10px 0; line-height: 1.4; }

.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }
.tags span {
    background: #f0f0f0;
    color: #555;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
}

/* Match Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}
.action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: 0.3s;
    background: white;
}
.action-btn:hover { transform: scale(1.1); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }

.pass { color: #ff4444; border: 2px solid #ff4444; }
.like { color: #00c851; border: 2px solid #00c851; }
.super { color: #33b5e5; border: 2px solid #33b5e5; font-size: 1.2rem; width: 50px; height: 50px; margin-top: 5px;}

/* RESPONSIVE */
@media (max-width: 900px) {
    .dashboard-container { flex-direction: column; }
    .sidebar {
        width: 90vw;
        height: auto;
        max-height: 25vh;
        margin: 10px auto;
        flex-direction: row;
        align-items: flex-start;
        padding: 15px;
    }
    .user-mini-profile { border-bottom: none; border-right: 1px solid rgba(0,0,0,0.05); padding-bottom: 0; padding-right: 15px; margin-bottom: 0; margin-right: 15px; flex-direction: column; gap: 5px; text-align: center;}
    .requests-section { flex: 1; overflow: hidden; display: flex; flex-direction: column; height: 100%;}
    .request-list { max-height: 150px; }
    .sidebar-footer { display: none; } /* Hide logout on mobile to save space */
    .top-bar { display: none; } /* Hide text logo on mobile */
    .card-stack { height: 65vh; max-width: 90vw;}
}















/* --- TOP RIGHT PROFILE --- */
.top-right-profile {
    position: absolute;
    top: 20px;
    right: 30px;
    padding: 8px 15px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
    cursor: pointer;
    transition: 0.3s;
}
.top-right-profile:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 127, 0.2);
}
.profile-info {
    text-align: right;
    display: flex;
    flex-direction: column;
}
.my-name {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--text-main);
}
.my-status {
    font-size: 0.7rem;
    color: #00c851; /* Green for online */
}
.my-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--neon-pink);
}
.my-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* --- HOVER STAT CARD LOGIC --- */

/* 1. Ensure the list item is the reference point */
.request-item {
    position: relative;
    /* ... keep previous request-item styles ... */
}

/* 2. The Pop-up Card Style */
/* --- UPDATED POPUP CARD STYLE --- */

.mini-stat-card {
    display: none;

    /* FIX: 'fixed' breaks it out of the sidebar so it's never cut off */
    position: fixed;
    left: 400px; /* Position it just to the right of the sidebar */
    top: 50%;
    transform: translateY(-50%); /* Center it vertically on screen */

    /* BIGGER SIZE */
    width: 340px;
    min-height: 450px;

    /* ON TOP OF EVERYTHING */
    z-index: 10000;

    /* STYLE */
    background: rgba(255, 255, 255, 0.95); /* Less transparent for readability */
    backdrop-filter: blur(25px);
    border: 1px solid var(--neon-pink);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy effect */
}

/* Show on hover */
.request-item:hover .mini-stat-card {
    display: block;
}

/* Image Section */
.mini-img {
    height: 180px; /* Taller image */
    width: 100%;
    position: relative;
}
.mini-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mini-img::after {
    /* Gradient overlay so text pops */
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 50px;
    background: linear-gradient(to top, rgba(255,255,255,1), transparent);
}

/* Content Section */
.mini-content {
    padding: 20px;
    text-align: left;
}

.mini-content h4 {
    margin: 0 0 5px 0;
    font-size: 1.4rem;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-age {
    background: var(--neon-lavender);
    color: white;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
}

/* THE LONG TEXT (PERSONALITY) */
.mini-bio {
    font-size: 0.95rem;
    color: #444;
    margin: 15px 0;
    line-height: 1.6; /* Good spacing for reading */

    /* Optional: Limit to 6 lines if it's too long */
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.mini-tags span {
    background: #fff0f5; /* Light pink bg */
    border: 1px solid var(--neon-pink);
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 15px;
    color: var(--neon-pink);
    font-weight: bold;
}

/* Animation */
@keyframes popIn {
    from { opacity: 0; transform: translateY(-45%) scale(0.9); }
    to { opacity: 1; transform: translateY(-50%) scale(1); }
}

/* MOBILE: Hide it because fixed positioning covers the screen on phones */
@media (max-width: 900px) {
    .request-item:hover .mini-stat-card { display: none; }
}


.pending-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 50px;
    max-width: 500px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.85); /* Slightly less transparent for focus */
    border: 1px solid rgba(181, 126, 220, 0.3); /* Lavender border */
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    animation: fadeIn 0.8s ease-out;
}

.pending-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: float 4s ease-in-out infinite;
}

.pending-card h2 {
    color: var(--neon-pink);
    font-size: 2rem;
    margin-bottom: 15px;
    margin-top: 0;
}

.pending-card p {
    color: #555;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Status Badge with Pulsing Dot */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff0f5; /* Light pink bg */
    border: 1px solid var(--neon-lavender);
    padding: 10px 20px;
    border-radius: 50px;
    color: var(--neon-lavender);
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: var(--neon-pink);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255, 0, 127, 0.7);
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 0, 127, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 0, 127, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 0, 127, 0);
    }
}