* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Login Screen */
.login-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, rgba(102,126,234,0.9) 0%, rgba(118,75,162,0.9) 100%); backdrop-filter: blur(6px); z-index: 3000; }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 24px; box-shadow: 0 25px 60px rgba(0,0,0,0.25); animation: modalSlideIn 0.3s ease-out; }
.login-form .submit-btn { margin-top: 8px; }
.login-error { color: #e53e3e; background: #fff5f5; border: 1px solid #fed7d7; padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-top: 6px; margin-bottom: 8px; }

.container {
    max-width: 1600px; /* 1400px'den 1600px'e çıkarıldı */
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #ffd700;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Layout Navigation */
.layout-nav { background: white; border-radius: 20px; padding: 20px; margin-bottom: 30px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); backdrop-filter: blur(10px); }
.nav-tabs { display: flex; gap: 10px; justify-content: center; }
.nav-tab { background: #f8fafc; color: #4a5568; border: 2px solid #e2e8f0; padding: 12px 18px; border-radius: 14px; cursor: pointer; transition: all 0.3s ease; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 160px; justify-content: center; }
.nav-tab:hover { background: #e2e8f0; border-color: #cbd5e0; transform: translateY(-2px); }
.nav-tab.active { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-color: #667eea; box-shadow: 0 8px 25px rgba(102,126,234,0.3); }
.nav-tab i { font-size: 16px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.operations-container { background: white; border-radius: 20px; padding: 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); backdrop-filter: blur(10px); }
.operations-container h2 { color: #4a5568; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; font-size: 1.4rem; }
.operations-list { display: flex; flex-direction: column; gap: 10px; }
.operation-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; font-size: 14px; color: #2d3748; display: flex; justify-content: space-between; align-items: center; }
.operation-meta { color: #64748b; font-size: 12px; }

/* İşlemler sayfalama */
.operations-pagination { display:flex; gap:8px; justify-content:center; align-items:center; margin-top:12px; flex-wrap:wrap; }
.operations-page-btn { background:#f1f5f9; border:1px solid #e2e8f0; color:#475569; padding:6px 10px; border-radius:8px; cursor:pointer; font-weight:600; }
.operations-page-btn.active { background:#667eea; color:#fff; border-color:#667eea; }
.operations-page-btn:hover { background:#e2e8f0; }

.main-content {
    display: grid;
    grid-template-columns: 1fr; /* Üste program, alta form için tek sütun */
    gap: 40px;
    margin-bottom: 40px;
}

.form-container, .appointments-list {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

/* Filtre barı */
.filters-bar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:14px; }
.filters-bar .date-range{ display:flex; gap:6px; align-items:center; }
.filters-bar select{ padding:10px 12px; border:2px solid #e2e8f0; border-radius:10px; background:#fff; }
.view-toggle{ margin-left:auto; display:flex; gap:8px; }
.view-toggle .toggle{ padding:10px 12px; border:2px solid #e2e8f0; border-radius:10px; background:#f8fafc; cursor:pointer; font-weight:600; }
.view-toggle .toggle.active{ background:#667eea; color:#fff; border-color:#667eea; }

.form-container h2, .appointments-list h3 {
    color: #4a5568;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
}

.form-container h2 i, .appointments-list h3 i {
    color: #667eea;
}

/* Hafta Navigasyonu */
.schedule-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.schedule-header-controls h3 {
    margin-bottom: 0;
}

.week-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8fafc;
    padding: 10px 15px;
    border-radius: 25px;
    border: 2px solid #e2e8f0;
}

.nav-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.nav-btn:hover {
    background: #5a67d8;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.current-week {
    font-weight: 600;
    color: #4a5568;
    font-size: 1rem;
    min-width: 120px;
    text-align: center;
}

.appointment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
}

label i {
    color: #667eea;
    width: 16px;
}

input, textarea {
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(-1px);
}

/* Ders Programı Tarzı Görünüm */
.schedule-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden; /* İçerideki grid'in taşmasını gizle; dış sarmalayıcı scroll alacak */
    border-radius: 12px;
}

/* Yatay kaydırma sarmalayıcı - mobilde 7 sütunu koruyup yatay scroll verelim */
.schedule-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
.schedule-scroll::-webkit-scrollbar { height: 8px; }
.schedule-scroll::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.4); border-radius: 8px; }
.schedule-scroll::-webkit-scrollbar-track { background: transparent; }

.schedule-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    min-width: 0; /* Grid taşmasını önle */
}

.schedule-header > div {
    background: #4a5568;
    color: white;
    padding: 18px 12px; /* 15px 10px'den 18px 12px'e çıkarıldı */
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 0; /* Grid taşmasını önle */
    word-wrap: break-word; /* Uzun metinleri sar */
}

.schedule-header .time-header {
    background: #2d3748;
    font-weight: 700;
}

.schedule-row {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    min-width: 0; /* Grid taşmasını önle */
}

.schedule-row:last-child {
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.schedule-row > div {
    background: white;
    padding: 12px 10px; /* 10px 8px'den 12px 10px'e çıkarıldı */
    text-align: center;
    font-size: 0.85rem;
    min-height: 70px; /* 60px'den 70px'e çıkarıldı */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 0; /* Grid taşmasını önle */
    overflow: hidden; /* İçerik taşmasını önle */
}

.schedule-row .time-slot {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
    border-right: 2px solid #e2e8f0;
}

/* Ana container'da overflow kontrolü */
.appointments-list {
    overflow: hidden; /* Yatay kaymayı önle */
}

.appointments-container {
    overflow: hidden; /* Yatay kaymayı önle */
}

.appointment-slot {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white;
    border-radius: 10px; /* 8px'den 10px'e çıkarıldı */
    margin: 4px; /* 3px'den 4px'e çıkarıldı */
    padding: 12px 10px; /* 10px 8px'den 12px 10px'e çıkarıldı */
    font-size: 0.85rem; /* 0.8rem'den 0.85rem'e çıkarıldı */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 50px; /* Minimum yükseklik eklendi */
}

.appointment-slot:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.appointment-slot .patient-name {
    font-weight: 600;
    margin-bottom: 4px; /* 3px'den 4px'e çıkarıldı */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem; /* Font boyutu artırıldı */
}

.appointment-slot .appointment-time {
    font-size: 0.8rem; /* 0.75rem'den 0.8rem'e çıkarıldı */
    opacity: 0.9;
    margin-bottom: 2px; /* Alt margin eklendi */
}

.appointment-slot .delete-icon {
    position: absolute;
    top: 3px; /* 2px'den 3px'e çıkarıldı */
    right: 3px; /* 2px'den 3px'e çıkarıldı */
    background: rgba(229, 62, 62, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px; /* 16px'den 18px'e çıkarıldı */
    height: 18px; /* 16px'den 18px'e çıkarıldı */
    font-size: 0.7rem; /* 0.6rem'den 0.7rem'e çıkarıldı */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.appointment-slot .delete-icon:hover {
    background: #e53e3e;
    transform: scale(1.1);
}

/* Yeni eklenen randevular için sarı vurgu */
.appointment-slot.appointment-new {
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%) !important;
    color: #1f2937;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.35);
    border: 1px solid rgba(245, 158, 11, 0.6);
}

/* Randevu durumlarına göre renkler */
.appointment-slot.status-pending {
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%) !important;
    color: #1f2937;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.35);
    border: 1px solid rgba(245, 158, 11, 0.6);
}

.appointment-slot.status-completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
    border: 1px solid rgba(5, 150, 105, 0.6);
}

/* Durum göstergesi */
.appointment-slot .status-indicator {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.appointment-slot.status-pending .status-indicator { background: #fbbf24; }
.appointment-slot.status-completed .status-indicator { background: #10b981; }

/* Modal Styles */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); backdrop-filter: blur(5px); }
.modal-content { background: white; margin: 0 auto; margin-top: 10px; padding: 0; border-radius: 16px; width: 90%; max-width: 480px; box-shadow: 0 20px 40px rgba(0,0,0,0.28); animation: modalSlideIn 0.3s ease-out; overflow: hidden; }
.modal-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.close-btn { background: rgba(255,255,255,0.2); border: none; color: white; padding: 8px; border-radius: 50%; cursor: pointer; transition: all 0.3s ease; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.close-btn:hover { background: rgba(255,255,255,0.3); transform: rotate(90deg); }
.edit-form { padding: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 12px; border-top: 1px solid #e2e8f0; }
.btn-primary, .btn-secondary { padding: 10px 16px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 8px; }
.btn-primary { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(16,185,129,0.4); }
.btn-secondary { background: #f1f5f9; color: #64748b; }
.btn-secondary:hover { background: #e2e8f0; transform: translateY(-2px); }
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(-50px) scale(0.9);} to { opacity: 1; transform: translateY(0) scale(1);} }
@media (max-width: 768px){ .modal-content{ margin:6% auto; width:95%; max-width: 90vw; } .modal-header{ padding:14px 16px;} .edit-form{ padding:14px;} .modal-actions{ flex-direction: column;} .btn-primary, .btn-secondary{ width:100%; justify-content:center;} }

/* Modal içeriklerini daha kompakt yap */
.edit-form input, .edit-form textarea { padding: 10px; font-size: 14px; border-radius: 10px; }
.edit-form .status-options { gap: 10px; }
.edit-form .status-box { padding: 14px 10px; min-height: 64px; }
.edit-form .status-box i { font-size: 1.2rem; }
.edit-form .status-box span { font-size: 0.85rem; }

/* Durum seçim kutuları */
.status-options { display: flex; gap: 15px; margin-top: 10px; }
.status-option { flex: 1; cursor: pointer; }
.status-option input[type="radio"] { display: none; }
.status-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 15px; border: 3px solid #e2e8f0; border-radius: 15px; transition: all 0.3s ease; background: #f8fafc; text-align: center; min-height: 80px; justify-content: center; }
.status-box i { font-size: 1.5rem; margin-bottom: 5px; }
.status-box span { font-weight: 600; font-size: 0.9rem; }
.status-box.status-pending { color: #d97706; }
.status-box.status-pending i { color: #f59e0b; }
.status-box.status-completed { color: #059669; }
.status-box.status-completed i { color: #10b981; }
.status-option input[type="radio"]:checked + .status-box { border-color: #667eea; background: white; transform: translateY(-3px); box-shadow: 0 8px 25px rgba(102,126,234,0.2); }
.status-option input[type="radio"]:checked + .status-box.status-pending { border-color: #f59e0b; box-shadow: 0 8px 25px rgba(245,158,11,0.2); }
.status-option input[type="radio"]:checked + .status-box.status-completed { border-color: #10b981; box-shadow: 0 8px 25px rgba(16,185,129,0.2); }
@media (max-width:480px){ .status-options{ flex-direction: column; gap:10px;} .status-box{ padding:15px 10px; min-height:70px;} .status-box i{ font-size:1.3rem;} .status-box span{ font-size:0.85rem;} }

.empty-state {
    text-align: center;
    color: #718096;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .schedule-header, .schedule-row {
        grid-template-columns: 80px repeat(5, 1fr);
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 15px;
    }
    
    .form-container, .appointments-list {
        padding: 20px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    /* 7 sütunu koru; yatay kaydırmayı .schedule-scroll alır */
    .schedule-header, .schedule-row { grid-template-columns: 80px repeat(7, 120px); font-size: 0.82rem; }
    .schedule-header > div, .schedule-row > div { padding: 10px 8px; font-size: 0.8rem; }
    
    .schedule-header-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .week-navigation {
        justify-content: center;
    }
    
    .current-week {
        min-width: auto;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header {
        margin-bottom: 30px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .form-container h2, .appointments-list h3 {
        font-size: 1.3rem;
    }
    
    input, textarea {
        padding: 12px;
    }
    
    .submit-btn {
        padding: 15px 25px;
        font-size: 16px;
    }
    
    /* Daha kompakt genişlikler ile 7 sütunu koru */
    .schedule-header, .schedule-row { grid-template-columns: 70px repeat(7, 110px); }
    .schedule-header .time-header, .schedule-row .time-slot { font-size: 0.7rem; padding: 6px 6px; }
    
    .nav-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .week-navigation {
        padding: 8px 12px;
    }
    
    .current-week {
        font-size: 0.8rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.appointment-slot {
    animation: fadeInUp 0.5s ease-out;
}

/* Success message - Küçük bildirim */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
    border-left: 4px solid #059669;
}

.success-message i {
    font-size: 16px;
    color: #d1fae5;
}

/* Bildirim animasyonları */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Bildirim kapanırken */
.success-message.fade-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Gün hücresi: birden fazla randevu için dikey yığın */
.day-cell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px; /* 6px'den 8px'e çıkarıldı */
    padding: 8px; /* 6px'den 8px'e çıkarıldı */
    min-height: 80px; /* Minimum yükseklik eklendi */
}

/* Varsayılan schedule hücresi merkezleme sadece boş/tek içerik için uygundu */
/* .schedule-row > div { ... } korunur; day-cell bunu override eder */
