/* CSS Reset & Variables */
:root {
    --bg-color: #0c0f1a;
    --primary: #ff4b4b; /* Vibrant Red/Pink */
    --primary-glow: rgba(255, 75, 75, 0.4);
    --secondary: #8b5cf6; /* Vibrant Violet */
    --secondary-glow: rgba(139, 92, 246, 0.4);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    
    --like: #10b981; /* Emerald */
    --like-glow: rgba(16, 185, 129, 0.4);
    --pass: #f43f5e; /* Rose */
    --pass-glow: rgba(244, 63, 94, 0.4);
    --super: #3b82f6; /* Blue */
    --super-glow: rgba(59, 130, 246, 0.4);

    --card-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    background: var(--bg-color);
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Background animated mesh */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #0f1225;
}
.bg-mesh::before, .bg-mesh::after {
    content: '';
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}
.bg-mesh::before {
    background: var(--primary);
    top: -20%;
    left: -10%;
}
.bg-mesh::after {
    background: var(--secondary);
    bottom: -20%;
    right: -10%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(15%, 15%) scale(1.2); }
}

/* App Container (Mobile Feel) */
.app-container {
    width: 100%;
    max-width: 420px;
    height: 100vh;
    max-height: 900px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden; /* Important to keep modal inside container bounds if desktop */
}

@media (min-width: 421px) {
    .app-container {
        height: 90vh;
        border-radius: 40px;
        border: 1px solid var(--glass-border);
    }
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.8), transparent);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
}

.icon-btn, .menu-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 1.2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-btn:hover, .menu-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.badge {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary-glow);
}

/* Main App Views */
.app-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app-view.active {
    opacity: 1;
}

.app-view.hidden {
    display: none;
}

/* Discovery Area */
.discovery-area {
    flex: 1;
    position: relative;
    padding: 0px 16px 10px 16px;
    perspective: 1200px;
}

.card-stack {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Placeholders for other tabs */
.placeholder-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
}
.placeholder-view h2 {
    color: var(--text-main);
    margin: 16px 0 8px 0;
    font-size: 1.8rem;
}
.mb-3 { margin-bottom: 1rem; }

/* Individual Profile Card */
.profile-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 30px;
    overflow: hidden;
    background-color: #1e293b;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    will-change: transform, opacity;
    cursor: grab;
    z-index: 1;
    background-size: cover;
    background-position: center;
}

.profile-card.dragging {
    transition: none;
    cursor: grabbing;
}

.profile-card.active {
    z-index: 10;
    transform: scale(1);
}

.profile-card.next {
    z-index: 5;
    transform: scale(0.95);
    opacity: 0.8;
}

.profile-card.sliding-right {
    transform: translateX(150%) rotate(25deg) !important;
    opacity: 0;
}

.profile-card.sliding-left {
    transform: translateX(-150%) rotate(-25deg) !important;
    opacity: 0;
}

/* Card Information Overlay */
.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 100px 24px 24px 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
    color: white;
    pointer-events: none; 
}

.card-info h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.age {
    font-weight: 400;
    font-size: 1.8rem;
    color: rgba(255,255,255,0.9);
}

.verified {
    color: var(--super);
    font-size: 1.2rem;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.location {
    font-size: 1.05rem;
    color: #e2e8f0;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}

.bio {
    font-size: 1rem;
    color: #cbd5e1;
    line-height: 1.5;
    margin-bottom: 16px;
    font-weight: 300;
}

.tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tag {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* View Profile Button on Card */
.view-profile-btn {
    pointer-events: auto;
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.view-profile-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Controls Area */
.controls {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 16px 30px;
    z-index: 10;
}

.control-btn {
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.control-btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    background: currentColor;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
    border-radius: 50%;
    transition: all 0.3s;
}

.control-btn:active::after {
    opacity: 0.2;
    transform: translate(-50%, -50%) scale(1);
    transition: 0s;
}

.btn-pass, .btn-like {
    width: 64px;
    height: 64px;
    font-size: 1.8rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.btn-super {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.btn-pass { color: var(--pass); }
.btn-like { color: var(--like); }
.btn-super { color: var(--super); }

.btn-pass:hover, .btn-pass.active {
    background: var(--pass);
    color: white;
    box-shadow: 0 10px 25px var(--pass-glow);
    transform: scale(1.1);
}

.btn-super:hover, .btn-super.active {
    background: var(--super);
    color: white;
    box-shadow: 0 10px 25px var(--super-glow);
    transform: scale(1.1) translateY(-5px);
}

.btn-like:hover, .btn-like.active {
    background: var(--like);
    color: white;
    box-shadow: 0 10px 25px var(--like-glow);
    transform: scale(1.1);
}

/* Full Profile Modal */
.profile-modal {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 50;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.profile-modal.open {
    transform: translateY(0);
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 55;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.modal-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Hide scrollbar for cleaner look */
.modal-content-scroll::-webkit-scrollbar {
    display: none;
}
.modal-content-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;  
}

.modal-header-img {
    width: 100%;
    height: 50vh;
    background-size: cover;
    background-position: center;
    position: relative;
}

.modal-header-img::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 150px;
    background: linear-gradient(to top, rgba(15, 23, 42, 1), transparent);
}

.modal-body {
    padding: 0 24px;
    margin-top: -40px;
    position: relative;
    z-index: 2;
}

.modal-name-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.modal-name-section .location {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.modal-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: white;
}

.modal-bio {
    color: #cbd5e1;
    line-height: 1.6;
    font-weight: 300;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 30px;
}

.modal-action-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 2rem;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-action-btn.no {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--pass);
}

.modal-action-btn.yes {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.modal-action-btn:hover {
    transform: scale(1.1);
}
.modal-action-btn.no:hover {
    background: var(--pass);
    color: white;
}


/* Main Application Footer */
.main-footer {
    padding: 10px 0 20px 0;
    background: rgba(15, 23, 42, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 10;
}

.footer-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    color: var(--text-muted);
    font-size: 1.3rem;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: 4px;
    box-shadow: 0 0 8px var(--primary-glow);
}

.nav-item:hover {
    color: white;
    transform: translateY(-2px);
}

/* No more cards state */
.no-cards {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
}
.no-cards .ring {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 2px solid transparent;
    margin: 0 auto 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255, 75, 75, 0.1) 0%, transparent 70%);
}
.no-cards .ring::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: pulse 2s infinite ease-out;
}
.no-cards .ring::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--secondary);
    animation: pulse 2s infinite ease-out 1s;
}
.no-cards h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 600;
}
.no-cards p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Drag overlay indicators */
.drag-indicator {
    position: absolute;
    top: 40px;
    padding: 8px 16px;
    border: 4px solid;
    border-radius: 12px;
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    z-index: 20;
    transition: opacity 0.2s;
}
.like-indicator {
    right: 40px;
    color: var(--like);
    border-color: var(--like);
    transform: rotate(15deg);
}
.pass-indicator {
    left: 40px;
    color: var(--pass);
    border-color: var(--pass);
    transform: rotate(-15deg);
}
