/* Film Robotu - Site Tasarımına Uyumlu */

/* ─── CONTAINER ─────────────────────────────────────────── */
.robot-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 24px 80px;
}

/* ─── KART ───────────────────────────────────────────────── */
.robot-card {
    position: relative;
    width: 100%;
    max-width: 720px;
    background: linear-gradient(165deg, #18181b 0%, #0c0c0e 100%);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 44px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    transition:
        max-width    0.6s cubic-bezier(0.23, 1, 0.32, 1),
        border-color 0.6s ease,
        box-shadow   0.6s ease,
        transform    0.6s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Gradient border katmanı */
.robot-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1.5px;
    background: linear-gradient(135deg,
        rgba(255,255,255,0.08) 0%,
        transparent 35%,
        transparent 65%,
        rgba(229,9,20,0.5) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

/* Ambient glow — revealed'da aktif */
.robot-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 21px;
    background: radial-gradient(
        ellipse 80% 40% at 50% 110%,
        rgba(229,9,20,0.2) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    z-index: 0;
}

.robot-card:hover::before { opacity: 0.7; }

.robot-card.selecting {
    transform: scale(0.985);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* ── Revealed: iki kolon layout ─────────────────────────── */
.robot-card.revealed {
    max-width: 1060px;
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
    border-color: rgba(229,9,20,0.25);
    box-shadow:
        0 12px 48px rgba(0,0,0,0.55),
        0 0 0 1px rgba(229,9,20,0.1),
        0 24px 80px rgba(229,9,20,0.07);
    transform: translateY(-2px);
}

.robot-card.revealed::before { opacity: 1; }
.robot-card.revealed::after  { opacity: 1; }

/* ─── POSTER KOLONU ─────────────────────────────────────── */
.card-poster-col {
    flex-shrink: 0;
    width: 0;
    overflow: hidden;
    opacity: 0;
    transition:
        width   0.6s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.5s ease 0.15s;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.robot-card.revealed .card-poster-col {
    width: 260px;
    opacity: 1;
    overflow: visible;
}

/* ─── KONTROL KOLONU ────────────────────────────────────── */
.card-controls-col {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.robot-card.revealed .card-controls-col {
    align-items: flex-start;
    text-align: left;
}

/* ─── BADGE ─────────────────────────────────────────────── */
.robot-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: linear-gradient(135deg, rgba(229,9,20,0.15) 0%, rgba(229,9,20,0.05) 100%);
    border: 1px solid rgba(229,9,20,0.3);
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--primary);
    margin-bottom: 20px;
}

.robot-title {
    font-family: 'Outfit', sans-serif;
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
    line-height: 1.2;
}

.robot-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
    line-height: 1.6;
    max-width: 380px;
}

/* ─── TİP TOGGLE ────────────────────────────────────────── */
.type-toggle {
    display: inline-flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 24px;
}

.type-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.type-btn svg { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.type-btn:hover { color: #fff; }

.type-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 2px 12px rgba(229,9,20,0.35);
}

.type-btn.active svg { transform: scale(1.15); }

/* ─── MOOD SEÇİCİ ───────────────────────────────────────── */
.mood-section {
    width: 100%;
    max-width: 100%;
    margin-bottom: 24px;
    overflow: hidden;
}

.mood-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.mood-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Seçim durumu hint metni */
.mood-hint {
    font-size: 11px;
    color: var(--text-muted);
    transition: color 0.3s ease;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mood-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mood-btn {
    --mood-color: rgba(255,255,255,0.15);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 12px 13px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
    text-align: left;
    position: relative;
    overflow: hidden;
}

/* Hover arka plan parlaması */
.mood-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--mood-color);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mood-btn:hover {
    border-color: color-mix(in srgb, var(--mood-color) 60%, transparent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.mood-btn:hover::after { opacity: 0.08; }

.mood-btn.active {
    border-color: color-mix(in srgb, var(--mood-color) 80%, transparent);
    background: color-mix(in srgb, var(--mood-color) 12%, var(--bg-input));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--mood-color) 40%, transparent),
                0 4px 20px color-mix(in srgb, var(--mood-color) 20%, transparent);
    transform: translateY(-1px);
}

.mood-btn.active::after { opacity: 0.12; }

/* İkon sarmalayıcı */
.mood-icon-wrap {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    transition: background 0.25s, color 0.25s, border-color 0.25s;
    position: relative;
    z-index: 1;
}

.mood-btn:hover .mood-icon-wrap {
    background: color-mix(in srgb, var(--mood-color) 18%, transparent);
    border-color: color-mix(in srgb, var(--mood-color) 40%, transparent);
    color: var(--mood-color);
}

.mood-btn.active .mood-icon-wrap {
    background: color-mix(in srgb, var(--mood-color) 22%, transparent);
    border-color: color-mix(in srgb, var(--mood-color) 50%, transparent);
    color: var(--mood-color);
}

.mood-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.mood-name {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #d4d4d8;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.mood-btn.active .mood-name { color: #fff; }

.mood-desc {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.mood-btn.active .mood-desc {
    color: color-mix(in srgb, var(--mood-color) 80%, #fff);
}

/* ─── TARAMA ŞERİDİ ─────────────────────────────────────── */
.scan-strip {
    width: 100%;
    max-width: 100%;
    height: 100px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 20px;
    position: relative;
    opacity: 0;
    max-height: 0;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    pointer-events: none;
}

.scan-strip.active { opacity: 1; max-height: 100px; }

.scan-strip::before,
.scan-strip::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 60px;
    z-index: 2;
    pointer-events: none;
}
.scan-strip::before { left: 0;  background: linear-gradient(to right, #0c0c0e, transparent); }
.scan-strip::after  { right: 0; background: linear-gradient(to left,  #0c0c0e, transparent); }

.scan-track {
    display: flex;
    gap: 10px;
    padding: 0 4px;
    will-change: transform;
}

@keyframes scanRoll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-72%); }
}

.scan-card {
    flex-shrink: 0;
    width: 70px;
    height: 100px;
    border-radius: 10px;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sc-poster { flex: 1; position: relative; overflow: hidden; }

.sc-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
    animation: shimmerSlide 1.2s ease-in-out infinite;
}

@keyframes shimmerSlide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.sc-lines {
    padding: 6px 6px 7px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0,0,0,0.3);
}

.sc-line { height: 5px; border-radius: 3px; }
.sc-line.short { width: 50%; }

/* ─── POSTER ────────────────────────────────────────────── */
.poster-container {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    background: var(--bg-card);
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    transition: box-shadow 0.6s ease;
}

.robot-card.revealed .poster-container {
    box-shadow:
        0 8px 40px rgba(0,0,0,0.6),
        0 0 0 1px rgba(229,9,20,0.15),
        0 16px 48px rgba(229,9,20,0.1);
}

.poster-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(255,255,255,0.5);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    transition: opacity 0.4s ease;
}

.poster-placeholder span {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#posterImage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#posterImage.loaded { opacity: 1; }

/* ─── BUTON ─────────────────────────────────────────────── */
.robot-btn {
    width: 100%;
    padding: 15px 24px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(229,9,20,0.3);
}

.robot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229,9,20,0.4);
}

.robot-btn:active { transform: translateY(0); }
.robot-btn.loading svg { animation: rotate 0.8s linear infinite; }

@keyframes rotate { to { transform: rotate(360deg); } }

/* ─── SONUÇ KARTI ───────────────────────────────────────── */
.movie-result {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.movie-result.revealed {
    opacity: 1;
    transform: translateY(0);
}

.result-inner {
    position: relative;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    overflow: hidden;
    text-align: left;
    transition: border-color 0.4s ease;
}

.robot-card.revealed .result-inner { border-color: rgba(229,9,20,0.2); }

@keyframes resultPulse {
    0%   { box-shadow: 0 0 0 0 rgba(229,9,20,0.25); }
    60%  { box-shadow: 0 0 0 8px rgba(229,9,20,0); }
    100% { box-shadow: 0 0 0 0 rgba(229,9,20,0); }
}

.movie-result.revealed .result-inner { animation: resultPulse 0.7s ease 0.3s 1; }

.result-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    transition: background 0.4s ease;
}

.result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.result-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--primary);
}

.result-rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid;
    transition: background 0.4s, border-color 0.4s, color 0.4s;
}

.result-inner h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.25;
    position: relative;
    z-index: 1;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-muted);
}

.meta-chip.year  { color: #a1a1aa; }

.meta-chip.genre {
    color: #a78bfa;
    border-color: rgba(167,139,250,0.3);
    background: rgba(167,139,250,0.08);
}

.watch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--accent-gradient);
    border-radius: 10px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, gap 0.2s;
    box-shadow: 0 4px 15px rgba(229,9,20,0.3);
    position: relative;
    z-index: 1;
}

.watch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229,9,20,0.45);
    gap: 12px;
}

.watch-arrow { opacity: 0.7; transition: transform 0.2s; }
.watch-btn:hover .watch-arrow { transform: translateX(3px); opacity: 1; }

/* ─── RESPONSIVE ────────────────────────────────────────── */

/* Tablet (≤860px): revealed'da tek kolon, poster+sonuç yatay */
@media (max-width: 860px) {
    .robot-container { padding: 40px 20px 60px; }

    .robot-card {
        padding: 36px 28px;
        max-width: 100%;
    }

    /* Revealed'da tek kolon düzene geç */
    .robot-card.revealed {
        max-width: 100%;
        flex-direction: column;
        gap: 24px;
        transform: none;
    }

    /* Poster kolonu: yatay şerit */
    .robot-card.revealed .card-poster-col {
        width: 100%;
        flex-direction: row;
        align-items: flex-start;
        gap: 16px;
        overflow: visible;
        opacity: 1;
    }

    .robot-card.revealed .poster-container {
        width: 120px;
        flex-shrink: 0;
    }

    .robot-card.revealed .movie-result { flex: 1; min-width: 0; }

    /* Revealed olmayan durumda poster kolonu gizli */
    .robot-card:not(.revealed) .card-poster-col { display: none; }

    /* Revealed'da kontroller sola hizalı kalır */
    .robot-card.revealed .card-controls-col {
        align-items: flex-start;
        text-align: left;
    }
}

/* Mobil (≤600px) */
@media (max-width: 600px) {
    .robot-container { padding: 24px 12px 48px; }

    .robot-card { padding: 28px 18px; border-radius: 16px; }
    .robot-card.revealed { gap: 20px; }

    .robot-title    { font-size: 22px; }
    .robot-subtitle { font-size: 13px; margin-bottom: 20px; }
    .robot-badge    { margin-bottom: 16px; }

    /* Type toggle tam genişlik */
    .type-toggle { width: 100%; justify-content: stretch; }
    .type-btn    { flex: 1; justify-content: center; padding: 10px 12px; }

    /* Mood grid: 2 kolon */
    .mood-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
    .mood-btn  { padding: 10px 10px; gap: 8px; }
    .mood-icon-wrap { width: 30px; height: 30px; border-radius: 8px; }
    .mood-name { font-size: 10.5px; }
    .mood-desc { display: none; } /* Mobilde desc gizle, yer kazanır */

    /* Poster + sonuç dikey */
    .robot-card.revealed .card-poster-col {
        flex-direction: row;
        align-items: flex-start;
        gap: 14px;
    }

    .robot-card.revealed .poster-container { width: 100px; }

    .result-inner { padding: 14px; }
    .result-inner h2 { font-size: 15px; }
    .result-rating-badge { font-size: 11px; padding: 3px 8px; }

    .watch-btn { width: 100%; justify-content: center; padding: 11px 16px; }

    .robot-btn { padding: 14px 20px; font-size: 14px; }
}

/* Küçük mobil (≤400px) */
@media (max-width: 400px) {
    .robot-container { padding: 16px 10px 40px; }
    .robot-card { padding: 22px 14px; border-radius: 14px; }

    .robot-title { font-size: 20px; }

    /* Mood grid: 2 kolon, daha kompakt */
    .mood-btn { padding: 9px 8px; gap: 7px; }
    .mood-icon-wrap { width: 28px; height: 28px; }
    .mood-name { font-size: 10px; }

    /* Poster daha küçük */
    .robot-card.revealed .poster-container { width: 85px; }
    .result-inner h2 { font-size: 14px; }

    /* Hint metni gizle */
    .mood-hint { display: none; }
}

/* Çok küçük (≤320px) */
@media (max-width: 320px) {
    .robot-card { padding: 18px 12px; }
    .mood-grid  { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .type-btn   { font-size: 12px; padding: 9px 8px; gap: 5px; }
}

/* Touch cihazlarda hover efektlerini kaldır */
@media (hover: none) {
    .mood-btn:hover    { transform: none; box-shadow: none; }
    .robot-btn:hover   { transform: none; }
    .watch-btn:hover   { transform: none; gap: 8px; }
    .mood-btn:active   { transform: scale(0.97); }
    .robot-btn:active  { transform: scale(0.98); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
