/* ============================================
   トビタテ面接トレーニング - Styles
   ============================================ */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --bg-card-glow: rgba(99, 102, 241, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #818cf8;
    --accent-secondary: #6366f1;
    --accent-glow: rgba(129, 140, 248, 0.3);
    --gradient-start: #6366f1;
    --gradient-end: #a78bfa;
    --border-subtle: rgba(148, 163, 184, 0.1);
    --border-card: rgba(129, 140, 248, 0.15);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 60px rgba(99, 102, 241, 0.05);
    --shadow-btn: 0 4px 20px rgba(99, 102, 241, 0.3);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100dvh;
    overscroll-behavior: none;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(167, 139, 250, 0.04) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-2%, -1%); }
    66% { transform: translate(1%, 2%); }
}

/* ============================================
   App Layout
   ============================================ */

.app {
    position: relative;
    z-index: 1;
    max-width: 430px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

/* ============================================
   Header
   ============================================ */

.header {
    text-align: center;
    padding: 20px 0 8px;
    flex-shrink: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
}

.header-icon {
    font-size: 24px;
    animation: planeFloat 3s ease-in-out infinite;
}

@keyframes planeFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-4px) rotate(3deg); }
}

.header h1 {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ============================================
   Category Filter
   ============================================ */

.category-filter {
    display: flex;
    gap: 6px;
    padding: 8px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.filter-btn:active {
    transform: scale(0.95);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-btn);
}

.filter-icon {
    font-size: 14px;
}

/* ============================================
   Question Card
   ============================================ */

.card-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    min-height: 0;
    perspective: 1000px;
}

.question-card {
    width: 100%;
    min-height: 220px;
    max-height: 380px;
    cursor: pointer;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    opacity: 0;
    transition: var(--transition-smooth);
}

.question-card.active::before {
    opacity: 1;
}

.question-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--bg-card-glow) 0%, transparent 70%);
    pointer-events: none;
}

/* Card animation states */
.question-card.flip-out {
    animation: flipOut 0.25s ease-in forwards;
}

.question-card.flip-in {
    animation: flipIn 0.35s ease-out forwards;
}

@keyframes flipOut {
    0% {
        transform: rotateX(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: rotateX(-15deg) scale(0.95) translateY(10px);
        opacity: 0;
    }
}

@keyframes flipIn {
    0% {
        transform: rotateX(15deg) scale(0.95) translateY(-10px);
        opacity: 0;
    }
    100% {
        transform: rotateX(0) scale(1);
        opacity: 1;
    }
}

.card-category {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 100px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.category-icon {
    font-size: 16px;
}

.category-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 0.5px;
}

.card-question {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.7;
    text-align: center;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.card-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.card-hint.show {
    max-height: 100px;
    opacity: 1;
}

/* ============================================
   Progress
   ============================================ */

.progress-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    flex-shrink: 0;
}

.progress-bar-container {
    flex: 1;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 100px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border-radius: 100px;
    transition: width var(--transition-smooth);
    box-shadow: 0 0 8px var(--accent-glow);
}

.progress-text {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Controls
   ============================================ */

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0 24px;
    flex-shrink: 0;
}

.btn-next {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-btn);
    position: relative;
    overflow: hidden;
}

.btn-next::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.btn-next:hover::before {
    left: 100%;
}

.btn-next:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.2);
}

.btn-next-icon {
    font-size: 18px;
    transition: transform var(--transition-fast);
}

.btn-next:active .btn-next-icon {
    transform: translateX(4px);
}

.btn-reset {
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.btn-reset:active {
    transform: scale(0.97);
    background: var(--bg-secondary);
}

/* ============================================
   Complete state
   ============================================ */

.question-card.complete {
    border-color: rgba(52, 211, 153, 0.3);
}

.question-card.complete::before {
    background: linear-gradient(90deg, #34d399, #6ee7b7);
    opacity: 1;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-height: 680px) {
    .header {
        padding: 12px 0 4px;
    }
    .card-container {
        padding: 8px 0;
    }
    .question-card {
        min-height: 180px;
        padding: 20px 20px;
    }
    .card-question {
        font-size: 16px;
    }
    .controls {
        padding: 8px 0 16px;
    }
    .btn-next {
        padding: 14px 20px;
    }
}

@media (min-height: 800px) {
    .question-card {
        min-height: 260px;
    }
    .card-question {
        font-size: 20px;
    }
}
