@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --secondary-dark: #db2777;
    --success: #10b981;
    --success-dark: #059669;
    --combined: #8b5cf6;
    --combined-dark: #7c3aed;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #0f172a;
    --text-gray: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.dpo-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Header */
.dpo-header {
    text-align: center;
    margin-bottom: 32px;
}

.dpo-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.dpo-header p {
    color: var(--text-gray);
    font-size: 1rem;
}

/* Form Card */
.dpo-form-card {
    background: var(--bg-white);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.dpo-form-group {
    margin-bottom: 20px;
}

.dpo-form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.dpo-form-group input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.938rem;
    transition: all 0.2s;
    background: var(--bg-white);
    font-family: inherit;
}

.dpo-form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dpo-label-hint {
    display: block;
    font-size: 0.813rem;
    color: var(--text-gray);
    font-weight: normal;
    margin-top: 4px;
}

/* Seçim Sayacı */
.dpo-counter-wrapper {
    margin: 16px 0;
    text-align: center;
}

.dpo-selected-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.dpo-count-number {
    font-size: 1.5rem;
    color: var(--primary);
}

.dpo-count-text {
    font-size: 0.938rem;
    color: var(--text-dark);
}

.dpo-count-target {
    font-size: 0.813rem;
    color: var(--text-gray);
}

.dpo-selected-count.warning {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.dpo-selected-count.warning .dpo-count-number {
    color: #f59e0b;
}

.dpo-selected-count.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.dpo-selected-count.success .dpo-count-number {
    color: var(--success);
}

/* Saat Seçim - Gün Satırları */
.dpo-time-selector {
    margin-top: 16px;
}

.dpo-day-row-select {
    margin-bottom: 20px;
    background: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
}

.dpo-day-header-select {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-bottom: 2px solid var(--border);
}

.dpo-day-emoji {
    font-size: 1.25rem;
}

.dpo-day-name {
    flex: 1;
    font-weight: 700;
    font-size: 0.938rem;
    color: var(--text-dark);
}

/* Saat Grid */
.dpo-hours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    padding: 16px;
}

.dpo-hour-item {
    position: relative;
}

.dpo-hour-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.dpo-hour-label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.dpo-hour-time {
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--text-gray);
}

.dpo-hour-item input[type="checkbox"]:checked + .dpo-hour-label {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.dpo-hour-item input[type="checkbox"]:checked + .dpo-hour-label .dpo-hour-time {
    color: white;
    font-weight: 700;
}

.dpo-hour-label:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.15);
}

.dpo-hour-item input[type="checkbox"]:checked + .dpo-hour-label:hover {
    transform: scale(1.05) translateY(-2px);
}

/* Branş Seçimi */
.dpo-branch-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.dpo-branch-option {
    position: relative;
}

.dpo-branch-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.dpo-branch-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-white);
    font-weight: 600;
    font-size: 0.938rem;
    color: var(--text-dark);
}

.dpo-branch-option input[type="radio"]:checked + .dpo-branch-label {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.dpo-branch-label:hover {
    border-color: var(--primary);
}

/* Saat Seçici - Kompakt Tablo Tasarımı */
.dpo-time-selector {
    margin-top: 12px;
}

.dpo-time-grid {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 16px;
    overflow-x: auto;
}

.dpo-time-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.dpo-time-table th {
    padding: 8px 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
    text-align: center;
    border-bottom: 2px solid var(--border);
}

.dpo-time-table td {
    padding: 4px;
    text-align: center;
}

.dpo-time-checkbox {
    position: relative;
}

.dpo-time-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.dpo-time-checkbox label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 45px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    background: white;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-gray);
    user-select: none;
}

.dpo-time-checkbox input[type="checkbox"]:checked + label {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}

.dpo-time-checkbox label:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.dpo-selected-count {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Submit Butonu */
.dpo-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.dpo-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.dpo-submit-btn:active {
    transform: translateY(0);
}

.dpo-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.dpo-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert */
.dpo-alert {
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 0.938rem;
    border-left: 4px solid;
}

.dpo-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: #065f46;
}

.dpo-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #991b1b;
}

/* Program Tablosu - Kompakt Tasarım */
.dpo-program-wrapper {
    background: var(--bg-white);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.dpo-program-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 20px 24px;
}

.dpo-program-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.dpo-program-header p {
    opacity: 0.95;
    font-size: 0.938rem;
}

/* İstatistikler - Kompakt */
.dpo-stats-compact {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
}

.dpo-stat-item {
    background: var(--bg-white);
    padding: 16px;
    text-align: center;
}

.dpo-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

.dpo-stat-value.primary { color: var(--primary); }
.dpo-stat-value.secondary { color: var(--secondary); }
.dpo-stat-value.success { color: var(--success); }

.dpo-stat-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-top: 4px;
    font-weight: 500;
}

/* Program Grid - Kompakt Tablo */
.dpo-program-content {
    padding: 24px;
}

.dpo-weekly-schedule {
    display: grid;
    gap: 16px;
}

.dpo-day-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    align-items: start;
}

.dpo-day-label {
    position: sticky;
    top: 0;
    background: var(--bg-light);
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-dark);
    text-align: center;
    align-self: start;
}

.dpo-day-lessons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dpo-lesson-compact {
    display: inline-flex;
    flex-direction: column;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid;
    min-width: 140px;
    transition: all 0.2s;
}

.dpo-lesson-compact:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.dpo-lesson-compact.ags {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--primary);
}

.dpo-lesson-compact.oabt {
    background: rgba(236, 72, 153, 0.08);
    border-color: var(--secondary);
}

.dpo-lesson-compact.tekrar {
    background: rgba(16, 185, 129, 0.08);
    border-color: var(--success);
}

.dpo-lesson-compact.birleşik {
    background: rgba(139, 92, 246, 0.08);
    border-color: var(--combined);
}

.dpo-lesson-time {
    font-size: 0.688rem;
    font-weight: 600;
    opacity: 0.7;
    margin-bottom: 2px;
}

.dpo-lesson-name {
    font-size: 0.813rem;
    font-weight: 600;
    line-height: 1.3;
}

.dpo-lesson-compact.ags .dpo-lesson-time,
.dpo-lesson-compact.ags .dpo-lesson-name {
    color: var(--primary-dark);
}

.dpo-lesson-compact.oabt .dpo-lesson-time,
.dpo-lesson-compact.oabt .dpo-lesson-name {
    color: var(--secondary-dark);
}

.dpo-lesson-compact.tekrar .dpo-lesson-time,
.dpo-lesson-compact.tekrar .dpo-lesson-name {
    color: var(--success-dark);
}

.dpo-lesson-compact.birleşik .dpo-lesson-time,
.dpo-lesson-compact.birleşik .dpo-lesson-name {
    color: var(--combined-dark);
}

/* Algoritma Açıklaması */
.dpo-algorithm-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.dpo-algorithm-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.dpo-algorithm-list {
    list-style: none;
    padding: 0;
}

.dpo-algorithm-list li {
    padding: 8px 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-dark);
}

/* Action Buttons */
.dpo-action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
}

.dpo-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.938rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dpo-btn-primary {
    background: var(--primary);
    color: white;
}

.dpo-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.dpo-btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.dpo-btn-secondary:hover {
    background: var(--primary);
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .dpo-day-row {
        grid-template-columns: 90px 1fr;
    }
    
    .dpo-lesson-compact {
        min-width: 130px;
    }
    
    .dpo-hours-grid {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
    }
}

@media (max-width: 768px) {
    .dpo-container {
        padding: 16px;
    }
    
    .dpo-header h1 {
        font-size: 1.5rem;
    }
    
    .dpo-form-card {
        padding: 20px;
    }
    
    .dpo-branch-selector {
        grid-template-columns: 1fr;
    }
    
    .dpo-stats-compact {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dpo-day-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .dpo-day-label {
        position: static;
    }
    
    .dpo-lesson-compact {
        min-width: 120px;
    }
    
    .dpo-action-buttons {
        flex-direction: column;
    }
    
    .dpo-hours-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 6px;
    }
    
    .dpo-hour-label {
        height: 40px;
    }
    
    .dpo-hour-time {
        font-size: 0.75rem;
    }
}

@media print {
    .dpo-form-card,
    .dpo-action-buttons,
    .dpo-algorithm-section {
        display: none !important;
    }
    
    .dpo-program-wrapper {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .dpo-lesson-compact {
        break-inside: avoid;
    }
}


/* Modern Gün Kartları */
.dpo-days-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.dpo-day-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s;
    border: 2px solid var(--border);
}

.dpo-day-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.dpo-day-card-header {
    padding: 18px 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    gap: 14px;
}

.dpo-day-card-emoji {
    font-size: 1.75rem;
    line-height: 1;
}

.dpo-day-card-name {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1;
}

.dpo-day-card-hours {
    padding: 24px;
}

.dpo-hour-section {
    margin-bottom: 20px;
}

.dpo-hour-section:last-child {
    margin-bottom: 0;
}

.dpo-hour-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-gray);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.dpo-hour-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.dpo-hour-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.dpo-hour-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 44px;
    padding: 10px 8px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    line-height: 1.2;
}

.dpo-hour-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.05);
}

.dpo-hour-checkbox:checked + .dpo-hour-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: var(--primary);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

@media (max-width: 1024px) {
    .dpo-days-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .dpo-days-container {
        grid-template-columns: 1fr;
    }
    
    .dpo-hour-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .dpo-hour-btn {
        min-height: 40px;
        font-size: 0.75rem;
        padding: 8px 6px;
    }
    
    .dpo-day-card-hours {
        padding: 20px;
    }
}
