/* ============================================
   FigoMatch - Garajın Sonundaki Aşk
   Premium Mobile Dating App Styles
   ============================================ */

/* --- CSS Variables --- */
:root {
    --figo-red: #D61834;
    --figo-red-glow: rgba(214, 24, 52, 0.4);
    --figo-dark: #25282A;
    --figo-darker: #1a1c1e;
    --white: #FFFFFF;
    --gray-100: #f5f5f5;
    --gray-200: #e8e8e8;
    --gray-400: #aaa;
    --gray-500: #888;
    --green: #2ecc71;
    --green-glow: rgba(46, 204, 113, 0.4);
    --card-radius: 18px;
    --btn-size: 64px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.35s ease;
    --transition-slow: 0.5s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Red Hat Display', sans-serif;
    background: var(--figo-dark);
    color: var(--white);
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

img {
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

/* --- Screens --- */
.screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
    z-index: 1;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* ========== SPLASH SCREEN ========== */
#splash-screen {
    background: var(--figo-darker);
}

.splash-logo {
    width: 120px;
    animation: splashPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

.splash-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--figo-red);
    margin-top: 20px;
    opacity: 0;
    animation: fadeSlideUp 0.6s ease 0.5s forwards;
}

.splash-subtitle {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 8px;
    opacity: 0;
    animation: fadeSlideUp 0.6s ease 0.8s forwards;
}

/* ========== INTRO SCREEN ========== */
#intro-screen {
    background: var(--figo-darker);
    padding: 40px 30px;
    text-align: center;
    gap: 24px;
}

.intro-logo {
    width: 80px;
    opacity: 0.9;
}

.intro-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
}

.intro-title span {
    color: var(--figo-red);
}

.intro-rules {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 300px;
}

.intro-rule {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
}

.intro-rule-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.intro-rule-icon.like {
    background: rgba(46, 204, 113, 0.15);
    border: 2px solid var(--green);
}

.intro-rule-icon.nope {
    background: rgba(214, 24, 52, 0.15);
    border: 2px solid var(--figo-red);
}

.intro-rule-icon.match {
    background: rgba(214, 24, 52, 0.15);
    border: 2px solid var(--figo-red);
}

.btn-start {
    width: 100%;
    max-width: 300px;
    padding: 18px 32px;
    background: var(--figo-red);
    color: var(--white);
    font-family: 'Red Hat Display', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    animation: pulse 2s ease-in-out infinite;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 4px 20px var(--figo-red-glow);
    margin-top: 8px;
}

.btn-start:active {
    transform: scale(0.96);
}

/* ========== SWIPE SCREEN ========== */
#swipe-screen {
    background: var(--figo-darker);
    justify-content: flex-start;
    padding-top: env(safe-area-inset-top, 16px);
}

/* Top Bar */
.swipe-top-bar {
    width: 100%;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 20;
}

.swipe-top-bar .top-logo {
    width: 40px;
    height: auto;
}

.swipe-top-bar .top-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-400);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Progress Bar */
.progress-bar-wrap {
    width: calc(100% - 40px);
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 20px 8px;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--figo-red);
    border-radius: 2px;
    transition: width var(--transition-normal);
}

/* Card Stack */
.card-stack {
    position: relative;
    width: calc(100% - 32px);
    max-width: 400px;
    flex: 1;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card */
.card {
    position: absolute;
    width: 100%;
    height: 92%;
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    will-change: transform, opacity;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
    opacity: 0;
    pointer-events: none;
}

.card.card-top {
    z-index: 5;
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
    transition: none;
}

.card.card-next {
    z-index: 4;
    transform: scale(0.95) translateY(12px);
    opacity: 1;
}

.card.card-behind {
    z-index: 3;
    transform: scale(0.9) translateY(24px);
    opacity: 0.6;
}

.card.card-swiped-right {
    transform: translateX(150%) rotate(20deg) !important;
    opacity: 0 !important;
    transition: transform 0.4s ease, opacity 0.4s ease !important;
    pointer-events: none;
}

.card.card-swiped-left {
    transform: translateX(-150%) rotate(-20deg) !important;
    opacity: 0 !important;
    transition: transform 0.4s ease, opacity 0.4s ease !important;
    pointer-events: none;
}

/* Card Image Area */
.card-image {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #f0f0f0 0%, #e0e0e0 100%);
    position: relative;
    padding: 16px;
    overflow: hidden;
}

.card-image img {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
}

/* LIKE / NOPE Stamps */
.stamp {
    position: absolute;
    top: 24px;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 3px;
    padding: 6px 16px;
    border-radius: 8px;
    border: 4px solid;
    opacity: 0;
    transform: rotate(-15deg);
    z-index: 10;
    pointer-events: none;
}

.stamp-like {
    left: 20px;
    color: var(--green);
    border-color: var(--green);
    transform: rotate(-15deg);
}

.stamp-nope {
    right: 20px;
    color: var(--figo-red);
    border-color: var(--figo-red);
    transform: rotate(15deg);
}

/* Card Info Area */
.card-info {
    padding: 16px 20px 14px;
    background: var(--white);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.card-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--figo-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-kasa {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--white);
    background: var(--figo-red);
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.card-location {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.card-caption {
    font-size: 0.8rem;
    font-weight: 600;
    font-style: italic;
    color: var(--figo-red);
    margin-bottom: 6px;
}

.card-bio {
    font-size: 0.85rem;
    color: #444;
    line-height: 1.45;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 14px 0 24px;
    z-index: 20;
}

.btn-action {
    width: var(--btn-size);
    height: var(--btn-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    border: 3px solid;
    cursor: pointer;
    background: transparent;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.btn-action:active {
    transform: scale(0.9);
}

.btn-nope {
    border-color: var(--figo-red);
    color: var(--figo-red);
}

.btn-nope:active {
    background: var(--figo-red);
    color: var(--white);
    box-shadow: 0 0 20px var(--figo-red-glow);
}

.btn-like {
    border-color: var(--green);
    color: var(--green);
}

.btn-like:active {
    background: var(--green);
    color: var(--white);
    box-shadow: 0 0 20px var(--green-glow);
}

/* ========== MATCH SCREEN ========== */
#match-screen {
    background: rgba(10, 10, 10, 0.96);
    z-index: 50;
    gap: 16px;
    padding: 40px 30px;
    text-align: center;
}

.match-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--figo-red);
    animation: heartbeat 1.5s ease infinite;
}

.match-subtitle {
    font-size: 1rem;
    color: var(--gray-400);
    font-weight: 500;
}

.match-car-image {
    width: 260px;
    max-width: 80%;
    filter: drop-shadow(0 0 30px var(--figo-red-glow));
    animation: floatCar 3s ease-in-out infinite;
}

.match-car-name {
    font-size: 1.5rem;
    font-weight: 800;
}

.match-car-kasa {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--figo-dark);
    background: var(--white);
    padding: 4px 14px;
    border-radius: 20px;
    display: inline-block;
}

.match-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 300px;
    margin-top: 8px;
}

.btn-whatsapp {
    padding: 16px;
    background: #25D366;
    color: var(--white);
    font-family: 'Red Hat Display', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform var(--transition-fast);
}

.btn-whatsapp:active { transform: scale(0.96); }

.btn-share {
    padding: 16px;
    background: transparent;
    color: var(--white);
    font-family: 'Red Hat Display', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50px;
    cursor: pointer;
    transition: transform var(--transition-fast);
    text-decoration: none;
    text-align: center;
    display: block;
}

.btn-share:active { transform: scale(0.96); }

.btn-retry {
    padding: 14px;
    background: transparent;
    color: var(--gray-500);
    font-family: 'Red Hat Display', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 4px;
}

/* ========== TESELLI SCREEN ========== */
#teselli-screen {
    background: rgba(10, 10, 10, 0.96);
    z-index: 50;
    gap: 20px;
    padding: 40px 30px;
    text-align: center;
}

.teselli-emoji {
    font-size: 5rem;
    animation: floatCar 2.5s ease-in-out infinite;
}

.teselli-title {
    font-size: 1.5rem;
    font-weight: 800;
}

.teselli-text {
    font-size: 1rem;
    color: var(--gray-400);
    font-weight: 500;
    line-height: 1.5;
    max-width: 280px;
}

/* ========== SHARE SCREEN (Instagram Story Card) ========== */
#share-screen {
    background: rgba(10, 10, 10, 0.98);
    z-index: 60;
    padding: 20px;
}

.share-hint {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 12px;
    font-weight: 600;
}

.story-card {
    width: 280px;
    aspect-ratio: 9/16;
    background: linear-gradient(180deg, var(--figo-dark) 0%, #1a1a2e 50%, var(--figo-red) 100%);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    gap: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    text-align: center;
}

.story-card .story-logo {
    width: 60px;
    opacity: 0.9;
}

.story-card .story-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gray-400);
}

.story-card .story-car-img {
    width: 200px;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.4));
    pointer-events: none;
}

.story-card .story-car-name {
    font-size: 1.3rem;
    font-weight: 800;
}

.story-card .story-match-text {
    font-size: 1rem;
    color: var(--figo-red);
    font-weight: 700;
}

.story-card .story-handle {
    font-size: 0.8rem;
    color: var(--gray-400);
    font-weight: 600;
}

.btn-close-share {
    margin-top: 16px;
    padding: 14px 40px;
    background: var(--white);
    color: var(--figo-dark);
    font-family: 'Red Hat Display', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.btn-close-share:active { transform: scale(0.96); }

/* ========== LOADING ========== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: var(--figo-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== ANIMATIONS ========== */
@keyframes splashPop {
    0% { opacity: 0; transform: scale(0.3); }
    70% { transform: scale(1.08); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 20px var(--figo-red-glow); }
    50% { transform: scale(1.04); box-shadow: 0 6px 30px var(--figo-red-glow); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.08); }
    60% { transform: scale(1); }
}

@keyframes floatCar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Safe area padding for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .action-buttons {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}
