/* ═══════════════════════════════════════════════════════════════
   SUDOKU — Design System & Stylesheet
   Modern, Native Apple HIG Aesthetic with WelcomeView1 Animated Showcases
   Developed by Barış Berke Çetin
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg: #F8F9FB;
    --bg-elevated: #FFFFFF;
    --card-bg: #FFFFFF;
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.16);
    --text: #111113;
    --text-muted: #686873;
    --text-subtle: #8E8E93;
    --card-shadow: rgba(0, 0, 0, 0.04);
    
    /* Sudoku Indigo Primary Palette */
    --sudoku-primary: #5856D6;
    --sudoku-primary-rgb: 88, 86, 214;
    --sudoku-primary-glow: rgba(88, 86, 214, 0.25);
    
    /* System & Theme Palettes */
    --color-easy: #34C759;
    --color-medium: #007AFF;
    --color-hard: #FF9500;
    --color-expert: #FF3B30;
    
    /* Cell styling */
    --cell-idle-bg: rgba(0, 0, 0, 0.04);
    --cell-empty-border: rgba(0, 0, 0, 0.16);
    
    --font-rounded: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, Monaco, monospace;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode {
    --bg: #000000;
    --bg-elevated: #161618;
    --card-bg: #121214;
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.22);
    --text: #F5F5F7;
    --text-muted: #A1A1A6;
    --text-subtle: #636366;
    --card-shadow: rgba(0, 0, 0, 0.5);
    
    --sudoku-primary: #5E5CE6;
    --sudoku-primary-rgb: 94, 92, 230;
    --sudoku-primary-glow: rgba(94, 92, 230, 0.35);
    
    --cell-idle-bg: rgba(255, 255, 255, 0.08);
    --cell-empty-border: rgba(255, 255, 255, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   Reset & Base Styles
   ═══════════════════════════════════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-rounded);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.35s ease, color 0.35s ease;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.container {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Language Toggle Display Rules */
body:not(.lang-en) .lang-en-text {
    display: none !important;
}

body.lang-en .lang-tr-text {
    display: none !important;
}

.font-mono {
    font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════════════════════
   Header Navigation
   ═══════════════════════════════════════════════════════════════ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: rgba(248, 249, 251, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.35s ease, border-color 0.35s ease;
}

body.dark-mode .site-header {
    background-color: rgba(0, 0, 0, 0.85);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.brand-logo-sudoku {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.brand-logo-sudoku:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.brand-logo-sudoku .brand-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: block;
}

body.dark-mode .brand-logo-sudoku .brand-icon {
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.12);
}

.brand-logo-sudoku .brand-name {
    font-family: var(--font-rounded);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.control-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 30px;
}

.control-btn:hover {
    border-color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════
   Hero Section & WelcomeView1 Animated Showcase
   ═══════════════════════════════════════════════════════════════ */
.hero-section {
    padding: 130px 0 70px 0;
    text-align: center;
    position: relative;
}

.hero-title {
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    max-width: 820px;
    margin: 0 auto 1.25rem auto;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.18rem);
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto 2.25rem auto;
    font-weight: 400;
    line-height: 1.6;
}

.download-action-group {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 3rem;
}

.testflight-badge-link {
    display: inline-block;
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    cursor: pointer;
}

.testflight-badge-link:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

.testflight-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    height: 48px;
    padding: 0 1.25rem 0 0.85rem;
    background: #000000;
    color: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: var(--transition);
}

body.dark-mode .testflight-badge-btn {
    background: #111113;
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.testflight-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: block;
    flex-shrink: 0;
}

.testflight-btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.testflight-subtext {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
}

.testflight-maintext {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════
   WelcomeView1 3x3 Animated Showcase Stage (Spacious & Floating)
   ═══════════════════════════════════════════════════════════════ */
.welcome1-showcase-stage {
    position: relative;
    max-width: 440px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 3x3 Block Grid (Matches WelcomeView.swift p1Cell) */
.welcome1-grid-3x3 {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 12px;
    width: 250px;
    height: 250px;
    margin: 0 auto;
}

.welcome1-cell {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    background: var(--cell-idle-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-rounded);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    border: 1.5px solid transparent;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

/* Dynamic Cells (5 in center, 9 in bottom-right) */
.welcome1-cell.is-dynamic {
    background: transparent;
    border: 1.5px dashed var(--cell-empty-border);
    color: transparent;
}

.welcome1-cell.is-placed {
    background: rgba(var(--sudoku-primary-rgb), 0.16);
    border: 1.5px solid var(--sudoku-primary);
    color: var(--sudoku-primary);
    transform: scale(1.04);
}

.welcome1-cell.is-wave {
    border-color: rgba(52, 199, 89, 0.6);
    background: rgba(52, 199, 89, 0.15);
    color: #34C759;
    transform: scale(1.04);
}

/* ═══════════════════════════════════════════════════════════════
   Bento Showcase Grid (Features)
   ═══════════════════════════════════════════════════════════════ */
.bento-section {
    padding: 80px 0 100px 0;
    border-top: 1px solid var(--border);
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    text-align: center;
    margin-bottom: 3.5rem;
}

.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
}

.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 2.25rem;
    box-shadow: 0 12px 32px var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.bento-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

.bento-card.wide {
    grid-column: span 2;
}

.bento-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bento-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bento-icon-badge.blue {
    background: rgba(0, 122, 255, 0.12);
    color: #007AFF;
}

.bento-icon-badge.orange {
    background: rgba(255, 149, 0, 0.12);
    color: #FF9500;
}

.bento-icon-badge.green {
    background: rgba(52, 199, 89, 0.12);
    color: #34C759;
}

.bento-icon-badge.purple {
    background: rgba(88, 86, 214, 0.12);
    color: var(--sudoku-primary);
}

.bento-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.bento-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

/* ═══════════════════════════════════════════════════════════════
   Bento 1: 4 Kademeli Zorluk Seviyesi (Balanced Equal Grid)
   ═══════════════════════════════════════════════════════════════ */
.difficulty-showcase-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    width: 100%;
}

.diff-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.1rem 0.4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 112px;
    box-shadow: 0 4px 12px var(--card-shadow);
}

.diff-name {
    font-size: 0.92rem;
    font-weight: 800;
}

.diff-clues {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-subtle);
    margin: 0.2rem 0;
}

.diff-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    line-height: 1.2;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   Bento 2: Streak & 7-Day Habit Heatmap
   ═══════════════════════════════════════════════════════════════ */
.streak-showcase-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
    width: 100%;
}

.streak-milestone-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 0.4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 98px;
    box-shadow: 0 4px 12px var(--card-shadow);
}

.milestone-emoji {
    font-size: 1.45rem;
    line-height: 1;
}

.milestone-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   Bento 3: Akıllı İpucu & Kurşun Kalem Notları (Animated Notes)
   ═══════════════════════════════════════════════════════════════ */
.pencil-notes-widget {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 4px 16px var(--card-shadow);
}

.notes-preview-cell-box {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notes-demo-cell {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(var(--sudoku-primary-rgb), 0.12);
    border: 1.5px solid var(--sudoku-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--sudoku-primary-glow);
}

.notes-pencil-tags {
    display: flex;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--sudoku-primary);
}

.notes-tag-removed {
    text-decoration: line-through;
    opacity: 0.35;
    color: var(--text-subtle);
}

.notes-widget-text {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════
   Bento 4: 5 Zarif Tema (Interactive Mini Board & Palette Rings)
   ═══════════════════════════════════════════════════════════════ */
.theme-showroom-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
}

/* Theme Active Pill */
.theme-active-pill {
    padding: 0.35rem 1.1rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    font-family: var(--font-rounded);
    background: rgba(var(--sudoku-primary-rgb), 0.14);
    color: var(--sudoku-primary);
    border: 1px solid rgba(var(--sudoku-primary-rgb), 0.28);
    transition: all 0.25s ease;
}

/* Mini 3x3 Board Preview */
.theme-mini-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 6px;
    width: 132px;
    height: 132px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 6px 20px var(--card-shadow);
}

.theme-mini-cell {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    background: var(--cell-idle-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-rounded);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
    transition: all 0.25s ease;
}

.theme-mini-cell.is-selected {
    background: var(--sudoku-primary) !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 8px var(--sudoku-primary-glow);
}

.theme-mini-cell.is-matching {
    background: rgba(var(--sudoku-primary-rgb), 0.25);
    color: var(--sudoku-primary);
}

/* 5 Theme Palette Rings Row */
.theme-palette-rings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
}

.theme-palette-button {
    flex: 1;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.theme-palette-button:hover {
    transform: translateY(-2px);
}

.theme-ring-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    padding: 2px;
    transition: all 0.25s ease;
}

.theme-palette-button.active .theme-ring-circle {
    border-color: var(--text);
    transform: scale(1.1);
}

.theme-inner-color {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.theme-ring-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
}

.theme-palette-button.active .theme-ring-label {
    color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════
   CTA Section
   ═══════════════════════════════════════════════════════════════ */
.cta-section {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--bg) 0%, rgba(var(--sudoku-primary-rgb), 0.06) 100%);
    border-top: 1px solid var(--border);
    text-align: center;
}

.cta-box {
    max-width: 680px;
    margin: 0 auto;
}

.cta-title {
    font-size: clamp(2.2rem, 4.5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.cta-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   Privacy & Terms Legal Document Pages
   ═══════════════════════════════════════════════════════════════ */
.privacy-page {
    padding-top: 120px;
    padding-bottom: 90px;
    max-width: 740px;
    margin: 0 auto;
}

.privacy-header {
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
}

.privacy-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.privacy-updated {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.privacy-section {
    margin-bottom: 2.5rem;
}

.privacy-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.85rem;
    color: var(--text);
}

.privacy-p {
    font-size: 0.98rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 0.85rem;
}

.privacy-list {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 1rem 0;
}

.privacy-list li {
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.98rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 0.45rem;
}

.privacy-list li::before {
    content: "•";
    position: absolute;
    left: 0.35rem;
    color: var(--text);
    font-weight: bold;
}

.back-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 2rem;
    font-weight: 600;
    transition: var(--transition);
}

.back-nav-btn:hover {
    color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.footer-copyright {
    color: var(--text-subtle);
}

.footer-links-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text);
    text-decoration: underline;
}

.footer-dot {
    color: var(--border);
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-card.wide {
        grid-column: span 1;
    }
    .difficulty-showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .streak-showcase-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .streak-showcase-grid .streak-milestone-box:nth-child(4),
    .streak-showcase-grid .streak-milestone-box:nth-child(5) {
        grid-column: span 1;
    }
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}
