/* WPAIM Brand Quiz */

html { scroll-behavior: smooth; }

/* Quiz wrapper */
.wpaim-quiz-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 25px 60px;
    font-family: 'Work Sans', sans-serif;
    scroll-margin-top: 130px;
    transition: padding-top 0.3s ease;
}

/* Hero compact */
.wpaim-quiz-hero-section.pg-hero {
    padding: 100px 25px 60px;
}

/* HATA 1+2+3: Hero gizlendiğinde header koyu arka plan + fixed + wrapper offset */
body.wpaim-hero-hidden .site-header {
    background: #040037 !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
body.wpaim-hero-hidden .wpaim-quiz-wrapper {
    padding-top: 130px;
}

.wpaim-quiz-progress-wrap {
    scroll-margin-top: 130px;
}

/* Labels */
.wpaim-quiz-label {
    display: inline-block;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #E21E51;
    margin-bottom: 12px;
}

/* Headings */
.wpaim-quiz-wrapper h2 {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 800;
    color: #040037;
    margin: 0 0 16px;
    line-height: 1.3;
}

.wpaim-quiz-subtitle {
    font-size: 1rem;
    color: #514d7c;
    line-height: 1.7;
    margin: 0 0 16px;
}

/* SORUN-7: Progress bar — navy to green, no red */
.wpaim-quiz-progress-wrap { margin-bottom: 28px; }
.wpaim-quiz-progress {
    background: #efeff5;
    border-radius: 20px;
    height: 6px;
    overflow: hidden;
}
.wpaim-quiz-progress-bar {
    background: linear-gradient(90deg, #032075, #16a34a);
    height: 100%;
    width: 0%;
    border-radius: 20px;
    transition: width 0.4s ease;
}
/* Progress step labels */
.wpaim-quiz-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 0 2px;
}
.wpaim-progress-label {
    font-size: 11px;
    font-weight: 600;
    color: #a0a0b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}
.wpaim-progress-label.active {
    color: #032075;
    font-weight: 700;
}
.wpaim-progress-label.completed {
    color: #16a34a;
}

/* BUG-2 + SORUN-15: Steps — display:none by default, animated on show */
.wpaim-quiz-step {
    background: #fff;
    border: 1px solid #deddeb;
    border-radius: 12px;
    padding: 36px 32px;
    margin-bottom: 20px;
    display: none;
}
.wpaim-quiz-step.wpaim-step-visible {
    display: block;
    animation: wpaim-fade-in 0.3s ease forwards;
}
@keyframes wpaim-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.wpaim-quiz-card {
    background: #fff;
    border: 1px solid #deddeb;
    border-radius: 12px;
    padding: 36px 32px;
    margin-bottom: 20px;
}

/* Input labels */
.wpaim-quiz-wrapper label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #040037;
    margin-bottom: 6px;
    margin-top: 16px;
}
.wpaim-quiz-wrapper label:first-of-type { margin-top: 0; }

/* SORUN-8: Focus border — navy, not red */
.wpaim-quiz-wrapper textarea,
.wpaim-quiz-wrapper input[type="text"],
.wpaim-quiz-wrapper input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #deddeb;
    border-radius: 8px;
    font-family: 'Work Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #040037;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.wpaim-quiz-wrapper textarea:focus,
.wpaim-quiz-wrapper input[type="text"]:focus,
.wpaim-quiz-wrapper input[type="email"]:focus {
    outline: none;
    border-color: #032075;
    box-shadow: 0 0 0 3px rgba(3, 32, 117, 0.1);
}
.wpaim-quiz-wrapper textarea::placeholder,
.wpaim-quiz-wrapper input::placeholder { color: #a0a0b8; }

/* Error state — only for errors, red */
.wpaim-quiz-wrapper .wpaim-input-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* Character counter */
.wpaim-char-count {
    text-align: right;
    font-size: 12px;
    color: #a0a0b8;
    margin: 2px 0 0;
    line-height: 1;
    transition: color 0.2s;
}
.wpaim-char-count.wpaim-char-warn { color: #ca8a04; font-weight: 600; }
.wpaim-char-count.wpaim-char-danger { color: #dc2626; font-weight: 700; }

/* Field error messages — red text */
.wpaim-field-error {
    font-size: 13px;
    color: #dc2626;
    margin: 4px 0 0;
    min-height: 0;
    display: none;
}
.wpaim-field-error:not(:empty) {
    display: block;
}

/* Helper text */
.wpaim-quiz-helper {
    font-size: 14px;
    font-weight: 600;
    color: #514d7c;
    margin: 16px 0 6px;
}
.wpaim-quiz-hint { font-weight: 400; color: #a0a0b8; }

/* Chips — min 44px tap target, BUG-1: no longer modifies textarea */
.wpaim-quiz-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 16px;
}
.wpaim-chip {
    padding: 10px 18px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #deddeb;
    border-radius: 22px;
    background: #fff;
    font-size: 14px;
    font-family: 'Work Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    color: #514d7c;
}
.wpaim-chip:hover { border-color: #032075; color: #032075; background: #fff; }
.wpaim-chip:focus { outline: 2px solid #032075; outline-offset: 2px; background: #fff; }
.wpaim-chip.active { background: #032075; color: #fff; border-color: #032075; }
.wpaim-chip.active:hover { background: #040037; }

/* Checkboxes */
.wpaim-quiz-checkboxes label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    min-height: 44px;
    border: 1px solid #deddeb;
    border-radius: 8px;
    margin: 0 0 8px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    font-size: 14px;
    font-weight: 400;
    color: #514d7c;
}
.wpaim-quiz-checkboxes label:hover { background: #f8f8fc; }
.wpaim-quiz-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #032075;
    flex-shrink: 0;
}
.wpaim-checkbox-other { flex-wrap: wrap; }
.wpaim-inline-input {
    flex: 1;
    min-width: 150px;
    padding: 6px 10px !important;
    border: 1px solid #deddeb !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    margin-top: 0 !important;
}

/* SORUN-11: Tone grid — disabled state when max reached */
.wpaim-tone-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.wpaim-tone-grid label { margin: 0; }
.wpaim-tone-grid label.wpaim-tone-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.wpaim-tone-msg:not(:empty) { margin-bottom: 8px; }

/* SORUN-6: Best/worst case color coding */
.wpaim-quiz-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}
.wpaim-quiz-two-col label { margin-top: 0; }
.wpaim-case-best { border-left: 3px solid #16a34a; padding-left: 16px; border-radius: 4px; }
.wpaim-case-worst { border-left: 3px solid #dc2626; padding-left: 16px; border-radius: 4px; }

/* Solution steps */
.wpaim-quiz-steps-list { margin-top: 8px; }
.wpaim-step-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.wpaim-step-row span {
    font-weight: 700;
    color: #032075;
    min-width: 24px;
    font-size: 15px;
}
.wpaim-step-row input { flex: 1; }
.wpaim-add-step {
    background: none;
    border: 1px dashed #deddeb;
    border-radius: 8px;
    padding: 10px 20px;
    min-height: 44px;
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    color: #514d7c;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: 4px;
}
.wpaim-add-step:hover { border-color: #032075; color: #032075; }
.wpaim-step-limit {
    text-align: center;
    font-size: 13px;
    color: #a0a0b8;
    padding: 10px;
}

/* SORUN-10: Examples — larger font, no italic, left border */
.wpaim-quiz-example {
    background: #f8f8fc;
    border-left: 3px solid #032075;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin-top: 20px;
    font-size: 15px;
    color: #514d7c;
    line-height: 1.7;
}
.wpaim-quiz-example strong {
    color: #040037;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.wpaim-quiz-example p { margin: 8px 0 0; }
.wpaim-quiz-tip {
    color: #032075 !important;
    font-weight: 600;
    font-size: 14px !important;
    border-top: 1px solid #efeff5;
    padding-top: 8px;
    margin-top: 12px !important;
}

/* Navigation */
.wpaim-quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    gap: 12px;
}

/* Buttons */
.wpaim-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    min-height: 48px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 15px;
    font-family: 'Work Sans', sans-serif;
    cursor: pointer;
    border: none;
    background: #E21E51;
    color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    text-align: center;
}
.wpaim-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(226, 30, 81, 0.3);
}
.wpaim-btn:disabled,
.wpaim-btn-next[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
    background: #a0a0b8;
}
.wpaim-btn-prev {
    background: transparent;
    color: #514d7c;
    border: 1px solid #deddeb;
}
.wpaim-btn-prev:hover { background: #f8f8fc; box-shadow: none; transform: none; }

.wpaim-btn-copy { background: #040037; font-size: 14px; padding: 12px 24px; }
.wpaim-btn-copy:hover { background: #032075; }
.wpaim-btn-copy.copied { background: #16a34a; }

/* Email step */
.wpaim-quiz-privacy { font-size: 12px; color: #a0a0b8; margin: 8px 0 0; }
.wpaim-quiz-privacy a { color: #514d7c; }

/* Loading */
.wpaim-quiz-loading-card {
    text-align: center;
    max-width: 480px;
    margin: 60px auto !important;
}
.wpaim-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #efeff5;
    border-top-color: #032075;
    border-radius: 50%;
    animation: wpaim-spin 0.8s linear infinite;
    margin: 0 auto 24px;
}
@keyframes wpaim-spin { to { transform: rotate(360deg); } }

/* Guide loading (inside result card) */
.wpaim-guide-loading {
    text-align: center;
    padding: 40px 20px;
    color: #514d7c;
}
.wpaim-guide-loading p { margin: 0; font-size: 14px; line-height: 1.6; }
.wpaim-spinner-sm {
    width: 32px;
    height: 32px;
    border: 3px solid #efeff5;
    border-top-color: #032075;
    border-radius: 50%;
    animation: wpaim-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
.wpaim-guide-error {
    color: #dc2626;
    font-size: 14px;
    line-height: 1.6;
}
.wpaim-guide-error a { color: #032075; text-decoration: underline; }

/* Results */
.wpaim-quiz-output {
    background: #f8f8fc;
    border: 1px solid #efeff5;
    border-radius: 8px;
    padding: 24px;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    margin: 16px 0 20px;
    max-height: 500px;
    overflow-y: auto;
    color: #040037;
}

/* Guide-specific output styles */
.wpaim-guide-output {
    max-height: none;
    white-space: normal;
    line-height: 1.7;
}
.wpaim-guide-output .wg-h4 {
    font-size: 16px;
    font-weight: 800;
    color: #040037;
    margin: 28px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #efeff5;
}
.wpaim-guide-output .wg-h4:first-child { margin-top: 0; }
.wpaim-guide-output .wg-h5 {
    font-size: 14px;
    font-weight: 700;
    color: #032075;
    margin: 20px 0 8px;
}
.wpaim-guide-output .wg-h6 {
    font-size: 13px;
    font-weight: 700;
    color: #514d7c;
    margin: 16px 0 6px;
}
.wpaim-guide-output .wg-divider {
    border: none;
    border-top: 1px solid #deddeb;
    margin: 24px 0;
}
.wpaim-guide-output .wg-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}
.wpaim-guide-output .wg-table td {
    padding: 8px 12px;
    border: 1px solid #efeff5;
    vertical-align: top;
}
.wpaim-guide-output .wg-table tr:first-child td {
    background: #040037;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.wpaim-guide-output .wg-code {
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
}
.wpaim-guide-output .wg-code pre {
    background: #040037;
    color: #e0e0f0;
    padding: 20px;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}
.wpaim-guide-output .wg-inline-code {
    background: #efeff5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    color: #032075;
}
.wpaim-guide-output strong {
    color: #040037;
}

.wpaim-quiz-cta {
    text-align: center;
    padding: 48px 32px;
    background: linear-gradient(135deg, #040037 0%, #032075 100%);
    border-radius: 12px;
    color: #fff;
    margin-top: 8px;
}
.wpaim-quiz-cta h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 800;
    margin: 0 0 12px;
    color: #fff;
}
.wpaim-quiz-cta p { color: rgba(255,255,255,0.8); font-size: 0.95rem; margin: 0 0 24px; }
.wpaim-quiz-cta .wpaim-btn { background: #E21E51; }

.wpaim-error-message { color: #dc2626; margin-bottom: 20px; }

/* HATA 5: Email step min-height */
.wpaim-quiz-step[data-step="6"] {
    min-height: 350px;
    display: none;
}
.wpaim-quiz-step[data-step="6"].wpaim-step-visible {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Tablet */
@media (max-width: 768px) {
    .wpaim-quiz-wrapper { padding: 20px 16px 40px; }
    .wpaim-quiz-step, .wpaim-quiz-card { padding: 24px 20px; }
    .wpaim-quiz-two-col { grid-template-columns: 1fr; }
    .wpaim-tone-grid { grid-template-columns: 1fr; }
    .wpaim-quiz-nav { flex-direction: column-reverse; }
    .wpaim-btn { width: 100%; }
    .wpaim-quiz-cta { padding: 32px 20px; }

    /* HATA 3: Mobil header offset */
    body.wpaim-hero-hidden .wpaim-quiz-wrapper { padding-top: 110px; }

    /* HATA 7: Mobil examples compact */
    .wpaim-quiz-example {
        padding: 12px 16px;
        font-size: 13px;
        line-height: 1.5;
        max-height: 200px;
        overflow-y: auto;
    }
    .wpaim-quiz-example p { margin: 6px 0 0; }
}

/* Mobile nav tap targets — min 44x44px (WCAG 2.5.8) */
@media (max-width: 768px) {
    .mobile-toggle-open-container .menu-toggle-open {
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px;
    }
    #mobile-drawer .drawer-header .drawer-toggle {
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px;
    }
    .wpaim-quiz-progress-labels { font-size: 10px; }
}

/* Small mobile */
@media (max-width: 480px) {
    /* HATA 6: Chip'ler daha compact */
    .wpaim-quiz-chips { gap: 6px; }
    .wpaim-chip {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 40px;
    }
}
