/* ==========================================================================
   Test Projesi - Ana Stil Dosyası
   ========================================================================== */

/* Reset ve Temel Stiller */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --background: #f8fafc;
    --surface: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Login Sayfası
   ========================================================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-primary);
}

/* ==========================================================================
   Admin Panel
   ========================================================================== */

.admin-container {
    min-height: 100vh;
    background: var(--background);
}

.admin-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-header nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.admin-header nav a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.admin-header nav a:hover,
.admin-header nav a.active {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

.admin-content {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ==========================================================================
   Form Elementleri
   ========================================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
    background: var(--surface);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small,
.help-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Butonlar
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #0891b2;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
}

/* ==========================================================================
   Cards ve Grid
   ========================================================================== */

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.test-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.test-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.test-card-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: start;
    border-bottom: 1px solid var(--border-color);
}

.test-card-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.test-card-body {
    padding: 20px;
}

.test-card-body p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.test-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.test-card-footer {
    padding: 16px 20px;
    background: var(--background);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    white-space: nowrap;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-secondary {
    background: rgba(100, 116, 139, 0.1);
    color: var(--secondary-color);
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* ==========================================================================
   Sorular ve Cevaplar
   ========================================================================== */

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.question-item {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 16px;
    align-items: start;
}

.question-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.question-content {
    flex: 1;
}

.question-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.question-meta {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.question-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Cevap Satırları */
.answer-row {
    display: grid;
    grid-template-columns: 30px 1fr 100px auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.answer-label {
    font-weight: 600;
    color: var(--primary-color);
}

/* ==========================================================================
   Sonuç Aralıkları
   ========================================================================== */

.result-ranges-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-range-item {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
}

.range-score {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.score-badge {
    background: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.range-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.range-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.range-actions {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Iframe Kod Sayfası
   ========================================================================== */

.iframe-code-container {
    max-width: 900px;
    margin: 0 auto;
}

.code-section {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.code-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.code-box {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.code-box code {
    display: block;
    white-space: pre-wrap;
    word-break: break-all;
}

.iframe-preview {
    margin-top: 16px;
    padding: 20px;
    background: var(--background);
    border-radius: var(--radius);
}

/* ==========================================================================
   Test Sayfası (Kullanıcı Görünümü)
   ========================================================================== */

.test-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

.test-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.test-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 32px;
    text-align: center;
}

.test-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}

.test-description {
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

.test-form {
    padding: 32px;
}

.question-block {
    margin-bottom: 32px;
    padding: 24px;
    background: var(--background);
    border-radius: var(--radius);
    border: 2px solid transparent;
    transition: all 0.3s;
}

.question-block.unanswered {
    border-color: var(--danger-color);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.question-header {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.question-block .question-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.question-block .question-text {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.answer-option:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.answer-option input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.answer-option input[type="radio"]:checked + .answer-text {
    color: var(--primary-color);
    font-weight: 500;
}

.answer-option:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.08);
}

.answer-text {
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
}

.test-footer {
    padding: 32px;
    background: var(--background);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* ==========================================================================
   Sonuç Ekranı
   ========================================================================== */

.result-container {
    padding: 40px 32px;
}

.result-header {
    text-align: center;
    margin-bottom: 32px;
}

.result-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.result-score {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50px;
}

.score-label {
    font-size: 14px;
    opacity: 0.9;
}

.score-value {
    font-size: 48px;
    font-weight: 700;
}

.score-max {
    font-size: 24px;
    opacity: 0.9;
}

.result-box {
    background: var(--background);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
}

.result-box.result-level-1 {
    border-left: 4px solid var(--success-color);
}

.result-box.result-level-2 {
    border-left: 4px solid var(--info-color);
}

.result-box.result-level-3 {
    border-left: 4px solid var(--warning-color);
}

.result-box.result-level-4 {
    border-left: 4px solid var(--danger-color);
}

.result-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.result-description {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.result-note {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
}

.result-actions {
    text-align: center;
}

/* ==========================================================================
   Tabs
   ========================================================================== */

.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
}

.tab-link {
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-link:hover,
.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-muted {
    color: var(--text-secondary);
    font-size: 14px;
}

.text-center {
    text-align: center;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.page-actions {
    display: flex;
    gap: 12px;
}

.form-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .admin-header nav {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .tests-grid {
        grid-template-columns: 1fr;
    }
    
    .question-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .question-actions {
        justify-content: stretch;
    }
    
    .question-actions .btn {
        flex: 1;
    }
    
    .test-card-footer {
        flex-direction: column;
    }
    
    .test-card-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .answer-row {
        grid-template-columns: 30px 1fr;
    }
    
    .answer-row input[type="number"] {
        grid-column: 2;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .page-actions {
        flex-direction: column;
    }
    
    .result-score {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .test-page {
        padding: 20px 10px;
    }
    
    .test-header {
        padding: 24px 20px;
    }
    
    .test-header h1 {
        font-size: 22px;
    }
    
    .test-form {
        padding: 20px;
    }
    
    .question-block {
        padding: 16px;
    }
    
    .result-container {
        padding: 24px 20px;
    }
    
    .score-value {
        font-size: 36px;
    }
}
