/* --- Ptest - Public Solver (Premium Redesign v7) --- */

:root {
    --ptest-primary: #3b82f6;
    /* Modern Blue */
    --ptest-primary-dark: #2563eb;
    --ptest-primary-light: #eff6ff;
    --ptest-success: #10b981;
    --ptest-text-main: #1f2937;
    --ptest-text-sub: #4b5563;
    --ptest-bg-card: #ffffff;
    --ptest-bg-page: #f3f4f6;
    --ptest-border: #e5e7eb;
    --ptest-radius: 12px;
    --ptest-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --ptest-transition: all 0.2s ease-in-out;
}

/* Validation Errors */
.ptest-question-item.has-error {
    border: 2px solid #ef4444 !important;
    border-radius: var(--ptest-radius);
    padding: 15px;
    background-color: #fef2f2;
}

/* ========================================= */
/* 1. Ana Konteynerler                       */
/* ========================================= */

.ptest-solver-form {
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ptest-text-main);
    line-height: 1.6;
}

/* Kart Stili */
#ptest-demographics-step,
#ptest-questions-step,
.ptest-results-container {
    background: var(--ptest-bg-card);
    border: 1px solid var(--ptest-border);
    border-radius: var(--ptest-radius);
    padding: 40px;
    box-shadow: var(--ptest-shadow);
    width: 100%;
    box-sizing: border-box;
    transition: var(--ptest-transition);
}

/* SonuÃ§ SayfasÄ± */
.ptest-results-container {
    margin: 40px auto;
}

/* BaÅŸlÄ±klar */
#ptest-demographics-step h2,
.ptest-results-container h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ptest-text-main);
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--ptest-border);
    letter-spacing: -0.025em;
}

/* ========================================= */
/* 2. Onay Formu / AydÄ±nlatma Metni          */
/* ========================================= */

.ptest-consent-form {
    background-color: var(--ptest-primary-light);
    border: 1px solid #dbeafe;
    /* Blue-100 */
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    max-height: 250px;
    overflow-y: auto;
    font-size: 0.95rem;
    color: var(--ptest-text-sub);
}

.ptest-consent-form::-webkit-scrollbar {
    width: 6px;
}

.ptest-consent-form::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

/* ========================================= */
/* 3. Form ElemanlarÄ± (Inputlar)             */
/* ========================================= */

.ptest-solver-form input[type="text"],
.ptest-solver-form input[type="email"],
.ptest-solver-form input[type="tel"],
.ptest-solver-form select,
.ptest-solver-form textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid var(--ptest-border);
    border-radius: 8px;
    background-color: #f9fafb;
    /* Gray-50 */
    color: var(--ptest-text-main);
    transition: var(--ptest-transition);
    outline: none;
    box-sizing: border-box;
}

.ptest-solver-form input:focus,
.ptest-solver-form select:focus,
.ptest-solver-form textarea:focus {
    border-color: var(--ptest-primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Telefon AlanÄ± Fix */
.ptest-solver-form .iti {
    width: 100%;
    margin-bottom: 20px;
}

/* ========================================= */
/* 4. Soru Listesi ve SeÃ§enekler             */
/* ========================================= */

.ptest-solver-form ol.ptest-questions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ptest-solver-form li.ptest-question-item {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--ptest-border);
    animation: fadeEffect 0.5s;
}

.ptest-solver-form li.ptest-question-item.is-hidden-by-condition {
    display: none !important;
}

.ptest-solver-form li.ptest-question-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

@keyframes fadeEffect {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Soru Metni */
.ptest-solver-form li.ptest-question-item h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ptest-text-main);
    margin: 0 0 20px 0;
}

/* Cevap SeÃ§enekleri (Grid YapÄ±sÄ± Opsiyonel, ÅŸimdilik flex column) */
.ptest-solver-form fieldset.ptest-answers {
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Radio Kart TasarÄ±mÄ± */
.ptest-solver-form div.ptest-answer-option label {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--ptest-border);
    border-radius: 10px;
    cursor: pointer;
    background-color: #fff;
    transition: var(--ptest-transition);
    font-weight: 500;
    color: var(--ptest-text-sub);
    position: relative;
    /* Before Ã¶gesi iÃ§in */
    box-sizing: border-box;
}

.ptest-solver-form div.ptest-answer-option label:hover {
    border-color: #93c5fd;
    /* Light Blue */
    background-color: #f8fafc;
}

/* Gizli Radio Buton */
.ptest-solver-form div.ptest-answer-option input[type="radio"] {
    display: none;
}

/* SeÃ§ili Durum */
.ptest-solver-form div.ptest-answer-option input[type="radio"]:checked+label {
    border-color: var(--ptest-primary);
    background-color: var(--ptest-primary-light);
    color: var(--ptest-primary-dark);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

/* Ã–zel Radio Ä°konu (Yuvarlak) */
.ptest-solver-form div.ptest-answer-option label::before {
    content: '';
    width: 20px;
    height: 20px;
    margin-right: 15px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    background-color: #fff;
    transition: var(--ptest-transition);
    flex-shrink: 0;
}

.ptest-solver-form div.ptest-answer-option input[type="radio"]:checked+label::before {
    border-color: var(--ptest-primary);
    background-color: var(--ptest-primary);
    box-shadow: inset 0 0 0 4px #fff;
    /* Ä°Ã§i beyaz halka */
}

/* ========================================= */
/* 5. Butonlar (Modern Gradient)             */
/* ========================================= */

.ptest-solver-form .button,
.ptest-solver-form input[type="submit"] {
    display: inline-block;
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, var(--ptest-primary) 0%, var(--ptest-primary-dark) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.ptest-solver-form .button:hover,
.ptest-solver-form input[type="submit"]:hover {
    box-shadow: 0 6px 10px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
    background: linear-gradient(135deg, #4f93f6 0%, #3070f0 100%);
}

.ptest-solver-form .button:active,
.ptest-solver-form input[type="submit"]:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Pagination ButonlarÄ± */
.ptest-pagination-nav {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--ptest-border);
}

.ptest-pagination-nav #ptest-pagination-prev.button {
    background: #f3f4f6;
    color: var(--ptest-text-sub);
    box-shadow: none;
    border: 1px solid var(--ptest-border);
}

.ptest-pagination-nav #ptest-pagination-prev.button:hover {
    background: #e5e7eb;
    color: var(--ptest-text-main);
    transform: none;
}

/* ========================================= */
/* 6. Progress Bar (Animasyonlu)             */
/* ========================================= */

.ptest-progress-container {
    margin-bottom: 30px;
}

.ptest-progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ptest-text-sub);
    margin-bottom: 8px;
    text-align: right;
}

.ptest-progress-bar {
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.ptest-progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--ptest-primary) 0%, var(--ptest-success) 100%);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
}

.ptest-scroll-progress {
    position: sticky;
    top: 20px;
    z-index: 100;
    background: var(--ptest-bg-card);
    padding: 10px;
    border-radius: var(--ptest-radius);
    box-shadow: var(--ptest-shadow);
    border: 1px solid var(--ptest-border);
}

.ptest-timer-container {
    background: #fffbe8;
    border: 1px solid #fde047;
    color: #854d0e;
    padding: 12px 20px;
    border-radius: var(--ptest-radius);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 500;
}

.ptest-timer-container.ptest-timer-danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
    animation: ptest-pulse 1.5s infinite;
}

@keyframes ptest-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* ========================================= */
/* 7. SonuÃ§ SayfasÄ±                          */
/* ========================================= */

.ptest-results-container ul li {
    background: #f8fafc;
    border: 1px solid var(--ptest-border);
    padding: 16px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
}

.ptest-results-container ul li strong {
    font-weight: 600;
    color: var(--ptest-text-main);
}

/* Grafik AlanÄ± */
.ptest-chart-container {
    background: #fff;
    border: 1px solid var(--ptest-border);
    border-radius: 8px;
    padding: 20px;
    margin: 30px auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Responsive DÃ¼zen */
@media (max-width: 600px) {

    #ptest-demographics-step,
    #ptest-questions-step,
    .ptest-results-container {
        padding: 20px;
        border-radius: 0;
        box-shadow: none;
        border-right: none;
        border-left: none;
        /* Mobilde tam geniÅŸlik */
    }

    .ptest-solver-form {
        margin: 0;
    }

    .ptest-pagination-nav {
        flex-direction: column-reverse;
        /* Ä°leri butonu Ã¼stte olsun */
    }

    .ptest-pagination-nav .button {
        width: 100%;
    }

    .ptest-results-container ul li {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ========================================= */
/* 8. Pagination (One Question Per Page)     */
/* ========================================= */

.ptest-solver-form.is-paginated .ptest-question-item {
    display: none;
}

.ptest-solver-form.is-paginated .ptest-question-item.is-active {
    display: block;
    animation: fadeEffect 0.5s;
}

/* Soru Tipleri Özel CSS */
.ptest-checkbox-option label {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--ptest-border);
    border-radius: 10px;
    cursor: pointer;
    background-color: #fff;
    transition: var(--ptest-transition);
    font-weight: 500;
}
.ptest-dropdown-select {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--ptest-border);
}
.ptest-likert-scale {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: #f9fafb;
    padding: 20px;
    border-radius: 10px;
}
.ptest-likert-options {
    display: flex;
    gap: 10px;
}
.ptest-likert-option {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ptest-likert-label {
    font-size: 0.9em;
    color: #6b7280;
}
.ptest-matrix-wrapper {
    overflow-x: auto;
}
.ptest-matrix-table {
    width: 100%;
    border-collapse: collapse;
}
.ptest-matrix-table th, .ptest-matrix-table td {
    padding: 10px;
    border-bottom: 1px solid var(--ptest-border);
    text-align: center;
}
.ptest-matrix-table .ptest-matrix-row-title {
    text-align: left;
    font-weight: bold;
}
.ptest-text-input, .ptest-textarea-input, .ptest-number-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--ptest-border);
    border-radius: 8px;
}


/* --- Profil Raporu (ProfileReport) --- */

.ptest-profile-summary {
    background: #fff;
    border: 1px solid var(--ptest-border);
    border-left: 4px solid var(--ptest-primary, #2271b1);
    border-radius: 8px;
    padding: 16px 20px;
    margin: 24px 0;
}

.ptest-profile-summary h4,
.ptest-profile-interpretations h4 {
    margin: 0 0 8px;
    font-size: 1.05em;
}

/* Dar ekranda tablo sayfayi yatay kaydirtmasin, kendi icinde kaysin */
.ptest-profile-table {
    display: block;
    overflow-x: auto;
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: #fff;
    border: 1px solid var(--ptest-border);
    border-radius: 8px;
}

.ptest-profile-table th,
.ptest-profile-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--ptest-border);
    white-space: nowrap;
}

.ptest-profile-table thead th {
    background: #f6f7f7;
    font-weight: 600;
}

.ptest-profile-table tbody tr:last-child td {
    border-bottom: none;
}

.ptest-profile-interp {
    padding: 12px 16px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid var(--ptest-border);
    border-left: 4px solid var(--ptest-border);
    border-radius: 6px;
}

.ptest-profile-interp p {
    margin: 6px 0 0;
}

/* Duzey renkleri: yalnizca sol kenarlik + hafif zemin.
   Renk TEK basina bilgi tasimaz; duzey etiketi tabloda metin olarak da yazar. */
.ptest-level-high {
    background: #fcf0ef;
    border-left-color: #d63638;
}

.ptest-level-low {
    background: #f0f6fc;
    border-left-color: #2271b1;
}

tr.ptest-level-high td {
    background: #fcf0ef;
}

tr.ptest-level-low td {
    background: #f0f6fc;
}
