/* ==========================================================================
   İstanbul Bilgi Kartları - Harfcan
   Hedef: 6-10 yaş, mobil öncelikli, erişilebilir
   ========================================================================== */

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

:root {
    /* Harfcan Renk Paleti */
    --hc-primary: #6C63FF;
    --hc-primary-light: #8B83FF;
    --hc-primary-dark: #4A42CC;
    --hc-secondary: #FF6B6B;
    --hc-accent: #FFC93C;
    --hc-success: #4ECB71;
    --hc-success-light: #E8F8EE;
    --hc-error: #FF8A65;
    --hc-error-light: #FFF0EB;
    --hc-info: #64B5F6;

    /* Nötr Tonlar */
    --hc-white: #FFFFFF;
    --hc-gray-50: #F8F9FC;
    --hc-gray-100: #F0F2F7;
    --hc-gray-200: #E2E5ED;
    --hc-gray-400: #9CA3B8;
    --hc-gray-600: #5A6178;
    --hc-gray-800: #2D3142;
    --hc-gray-900: #1A1D2E;

    /* Tipografi */
    --hc-font: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    --hc-font-rounded: 'Nunito', var(--hc-font);

    /* Boyutlar */
    --hc-radius-sm: 8px;
    --hc-radius-md: 14px;
    --hc-radius-lg: 20px;
    --hc-radius-xl: 28px;
    --hc-shadow-sm: 0 2px 8px rgba(45, 49, 66, 0.06);
    --hc-shadow-md: 0 4px 20px rgba(45, 49, 66, 0.10);
    --hc-shadow-lg: 0 8px 40px rgba(45, 49, 66, 0.14);

    /* Animasyon */
    --hc-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --hc-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Azaltılmış hareket tercihi */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

body {
    font-family: var(--hc-font);
    background: var(--hc-gray-50);
    color: var(--hc-gray-800);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---------- Header ---------- */
.hc-header {
    background: var(--hc-white);
    border-bottom: 1px solid var(--hc-gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--hc-shadow-sm);
}

.hc-header__inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hc-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.hc-header__logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.hc-header__logo-text {
    display: none;
    align-items: center;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--hc-primary), var(--hc-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hc-header__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hc-gray-800);
    flex: 1;
}

.hc-header__nav {
    flex-shrink: 0;
}

.hc-header__link {
    font-size: 0.85rem;
    color: var(--hc-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: var(--hc-radius-sm);
    transition: background var(--hc-transition);
}

.hc-header__link:hover,
.hc-header__link:focus-visible {
    background: var(--hc-gray-100);
}

/* ---------- Main ---------- */
.hc-main {
    max-width: 560px;
    margin: 0 auto;
    padding: 16px 16px 40px;
}

/* ---------- Progress Bar ---------- */
.hc-progress {
    height: 6px;
    background: var(--hc-gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.hc-progress__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--hc-primary), var(--hc-primary-light));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ---------- Stats ---------- */
.hc-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
}

.hc-stats__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--hc-gray-600);
}

.hc-stats__item--correct .hc-stats__icon {
    color: var(--hc-success);
    font-weight: 700;
}

/* ---------- Card ---------- */
.hc-card {
    background: var(--hc-white);
    border-radius: var(--hc-radius-lg);
    box-shadow: var(--hc-shadow-md);
    overflow: hidden;
    position: relative;
    animation: fadeInUp 0.4s ease;
}

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

.hc-card__tag {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    color: var(--hc-primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.2px;
}

/* Image */
.hc-card__image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--hc-gray-100);
    overflow: hidden;
}

.hc-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity var(--hc-transition);
}

.hc-card__image[src=""],
.hc-card__image.hc-hidden {
    opacity: 0;
    position: absolute;
}

/* Placeholder */
.hc-card__image-placeholder {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--hc-primary-light), var(--hc-info));
}

.hc-card__image-placeholder.hc-visible {
    display: flex;
}

.hc-card__placeholder-icon {
    font-size: 3rem;
}

.hc-card__placeholder-text {
    color: var(--hc-white);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    padding: 0 20px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Body */
.hc-card__body {
    padding: 20px;
}

.hc-card__question {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--hc-gray-900);
    margin-bottom: 16px;
    line-height: 1.4;
}

/* Choices */
.hc-card__choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
}

.hc-choice-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--hc-gray-200);
    border-radius: var(--hc-radius-md);
    background: var(--hc-white);
    font-size: 1rem;
    font-weight: 600;
    color: var(--hc-gray-800);
    cursor: pointer;
    transition: all var(--hc-transition);
    text-align: left;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
}

.hc-choice-btn:hover:not(:disabled) {
    border-color: var(--hc-primary-light);
    background: var(--hc-gray-50);
    transform: translateY(-1px);
    box-shadow: var(--hc-shadow-sm);
}

.hc-choice-btn:focus-visible {
    outline: 3px solid var(--hc-primary-light);
    outline-offset: 2px;
}

.hc-choice-btn:disabled {
    cursor: default;
}

.hc-choice-btn__key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--hc-gray-100);
    color: var(--hc-gray-600);
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all var(--hc-transition);
}

/* Choice states */
.hc-choice-btn--correct {
    border-color: var(--hc-success);
    background: var(--hc-success-light);
    animation: popIn var(--hc-bounce);
}

.hc-choice-btn--correct .hc-choice-btn__key {
    background: var(--hc-success);
    color: var(--hc-white);
}

.hc-choice-btn--wrong {
    border-color: var(--hc-error);
    background: var(--hc-error-light);
    animation: shake 0.4s ease;
}

.hc-choice-btn--wrong .hc-choice-btn__key {
    background: var(--hc-error);
    color: var(--hc-white);
}

.hc-choice-btn--dimmed {
    opacity: 0.5;
}

@keyframes popIn {
    0% { transform: scale(0.95); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* Feedback */
.hc-card__feedback {
    display: none;
    padding: 10px 14px;
    border-radius: var(--hc-radius-sm);
    margin-top: 12px;
    font-weight: 600;
    font-size: 0.95rem;
}

.hc-card__feedback.hc-visible {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.hc-card__feedback--correct {
    background: var(--hc-success-light);
    color: #1B7A3D;
}

.hc-card__feedback--wrong {
    background: var(--hc-error-light);
    color: #C94A1E;
}

/* Explanation */
.hc-card__explanation {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: var(--hc-gray-50);
    border-radius: var(--hc-radius-md);
    border-left: 4px solid var(--hc-primary);
}

.hc-card__explanation.hc-visible {
    display: block;
    animation: fadeInUp 0.4s ease;
}

.hc-card__explanation-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--hc-primary-dark);
    margin-bottom: 6px;
}

.hc-card__explanation-text {
    font-size: 0.92rem;
    color: var(--hc-gray-600);
    line-height: 1.6;
}

/* Post-answer Actions */
.hc-card__post-actions {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    justify-content: center;
}

.hc-card__post-actions.hc-visible {
    display: flex;
    animation: fadeInUp 0.3s ease 0.1s backwards;
}

/* ---------- Buttons ---------- */
.hc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--hc-font);
    font-weight: 700;
    border: none;
    border-radius: var(--hc-radius-md);
    cursor: pointer;
    transition: all var(--hc-transition);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.hc-btn:focus-visible {
    outline: 3px solid var(--hc-primary-light);
    outline-offset: 2px;
}

.hc-btn--primary {
    padding: 14px 28px;
    font-size: 1rem;
    background: var(--hc-primary);
    color: var(--hc-white);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.hc-btn--primary:hover {
    background: var(--hc-primary-dark);
    transform: translateY(-1px);
}

.hc-btn--outline {
    padding: 12px 20px;
    font-size: 0.9rem;
    background: var(--hc-white);
    color: var(--hc-gray-600);
    border: 2px solid var(--hc-gray-200);
}

.hc-btn--outline:hover {
    border-color: var(--hc-primary-light);
    color: var(--hc-primary);
    background: var(--hc-gray-50);
}

.hc-btn--small {
    padding: 8px 14px;
    font-size: 0.82rem;
    border-radius: var(--hc-radius-sm);
}

/* Nav Buttons */
.hc-btn--nav {
    padding: 12px 20px;
    font-size: 0.95rem;
    background: var(--hc-white);
    color: var(--hc-primary);
    border: 2px solid var(--hc-gray-200);
    border-radius: var(--hc-radius-md);
    min-width: 100px;
}

.hc-btn--nav:hover:not(:disabled) {
    border-color: var(--hc-primary);
    background: var(--hc-gray-50);
}

.hc-btn--nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- Navigation ---------- */
.hc-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    gap: 8px;
}

.hc-nav__counter {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--hc-gray-400);
}

/* ---------- Completion Screen ---------- */
.hc-complete {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(248, 249, 252, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease;
}

.hc-complete[hidden] {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hc-complete__inner {
    text-align: center;
    padding: 32px 24px;
    max-width: 420px;
    width: 100%;
}

.hc-complete__icon {
    font-size: 4rem;
    margin-bottom: 12px;
    animation: popIn var(--hc-bounce) 0.2s backwards;
}

.hc-complete__title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--hc-gray-900);
    margin-bottom: 8px;
}

.hc-complete__subtitle {
    font-size: 1.05rem;
    color: var(--hc-gray-600);
    margin-bottom: 24px;
}

.hc-complete__stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 28px;
}

.hc-complete__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hc-complete__stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--hc-primary);
}

.hc-complete__stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--hc-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hc-complete__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* Confetti */
.hc-confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 201;
}

/* ---------- Utility Classes ---------- */
.hc-hidden {
    display: none !important;
}

.hc-visible {
    /* Used to show hidden elements */
}

/* ---------- Responsive ---------- */

/* Tablet */
@media (min-width: 600px) {
    .hc-main {
        padding: 24px 24px 48px;
    }

    .hc-card__body {
        padding: 24px 28px;
    }

    .hc-card__question {
        font-size: 1.35rem;
    }

    .hc-choice-btn {
        padding: 16px 20px;
        font-size: 1.05rem;
    }

    .hc-header__inner {
        padding: 14px 24px;
    }
}

/* Desktop */
@media (min-width: 900px) {
    .hc-main {
        max-width: 640px;
        padding: 32px 24px 56px;
    }

    .hc-card {
        border-radius: var(--hc-radius-xl);
    }

    .hc-card__image-wrap {
        aspect-ratio: 16 / 9;
    }

    .hc-header__logo-img {
        height: 36px;
    }

    .hc-header__title {
        font-size: 1.2rem;
    }

    .hc-choice-btn {
        padding: 16px 22px;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .hc-header__title {
        font-size: 0.95rem;
    }

    .hc-header__link {
        font-size: 0.78rem;
        padding: 4px 8px;
    }

    .hc-card__body {
        padding: 16px;
    }

    .hc-card__question {
        font-size: 1.05rem;
    }

    .hc-btn--nav {
        padding: 10px 14px;
        font-size: 0.85rem;
        min-width: 80px;
    }
}
