/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: #3498db;
}

.logo h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-weight: 500;
    color: #34495e;
}


/* Filter Section */
.filter-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.filter-header {
    margin-bottom: 20px;
}

.filter-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
    font-size: 1.4rem;
}

.filter-header i {
    color: #3498db;
}

.day-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.day-btn {
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.day-btn:hover {
    background: #f8f9fa;
    border-color: #3498db;
}

.day-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2.5rem;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Cards Container */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

/* Doctor Card */
.doctor-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.doctor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.doctor-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
}


.doctor-info h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.doctor-info p {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Tabs */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.tab-btn:hover {
    background: #e9ecef;
}

.tab-btn.active {
    background: white;
    color: #3498db;
    border-bottom: 3px solid #3498db;
}

/* Tab Content */
.tab-content {
    padding: 25px;
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.quota-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.quota-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.quota-item:last-child {
    margin-bottom: 0;
}

.quota-label {
    color: #666;
    font-weight: 500;
}

.quota-value {
    font-weight: 600;
    color: #2c3e50;
}

.quota-value.available {
    color: #27ae60;
}

.quota-value.booked {
    color: #e74c3c;
}

.quota-value.total {
    color: #3498db;
}

.progress-bar {
    height: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.edit-btn {
    width: 100%;
    padding: 14px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.edit-btn:hover {
    background: #2980b9;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    display: none;
}

.loading.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.text-muted {
    display: block;
    margin-top: 5px;
    color: #95a5a6;
    font-size: 0.85rem;
}

.info-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    color: #666;
    font-weight: 500;
}

.info-value {
    font-weight: 600;
    color: #2c3e50;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 20px;
    }
    
    .logo {
        flex-direction: column;
        text-align: center;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .day-filter {
        justify-content: center;
    }
    
    .doctor-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .modal-content {
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .day-btn {
        flex: 1;
        min-width: calc(50% - 10px);
        text-align: center;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 12px;
    }
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 1001;
    animation: slideIn 0.3s ease, slideOut 0.3s ease 2.7s;
    max-width: 300px;
}

.notification.success {
    background: #27ae60;
}

.notification.error {
    background: #e74c3c;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ... kode sebelumnya tetap ... */

/* Error Message & No Data */
.error-message, .no-data {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    grid-column: 1 / -1;
}

.error-message i, .no-data i {
    font-size: 4rem;
    color: #e74c3c;
    margin-bottom: 20px;
}

.no-data i {
    color: #95a5a6;
}

.error-message h3, .no-data h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.error-message p, .no-data p {
    color: #7f8c8d;
    font-size: 1rem;
}

/* Doctor Avatar - SELALU BULAT */
.doctor-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    overflow: hidden;
    position: relative;
    flex-shrink: 0; /* Mencegah avatar mengecil */
}

.doctor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback untuk gambar yang tidak ada */
.doctor-avatar i.fa-user-md {
    font-size: 2.5rem;
    color: white;
    z-index: 1;
}

/* Pastikan foto selalu bulat bahkan jika ada border */
.doctor-avatar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    padding: 40px;
    animation: fadeIn 0.5s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 3.5rem;
    color: #3498db;
    margin-bottom: 15px;
}

.login-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.login-header p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Login Form */
#loginForm .form-group {
    margin-bottom: 25px;
    position: relative;
}

#loginForm label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

#loginForm label i {
    color: #3498db;
    width: 20px;
}

#loginForm input {
    width: 100%;
    padding: 14px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#loginForm input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 40px;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #3498db;
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    color: #95a5a6;
    font-size: 0.85rem;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

/* Logout Button */
.btn-logout {
    background: #2980b9;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-logout:hover {
    background: #1f618d;
    transform: translateY(-1px);
}

.user-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.user-display i {
    font-size: 1.2rem;
    color: #3498db;
}

/* Header adjustments */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-time {
    font-size: 0.9rem;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-time i {
    color: #3498db;
}

/* Error message for login */
.login-error {
    background: #fde8e8;
    color: #c53030;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 10px;
    animation: shake 0.5s ease;
}

.login-error.show {
    display: flex;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Session timeout warning */
.session-warning {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #f39c12;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.session-warning.show {
    display: flex;
}

.session-warning i {
    font-size: 1.2rem;
}

/* Responsive login */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .login-header i {
        font-size: 3rem;
    }
    
    .login-header h2 {
        font-size: 1.3rem;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-display {
        justify-content: center;
    }
}

/* Extend session button */
.btn-extend {
    background: white;
    color: #f39c12;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-extend:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

.session-warning div {
    flex: 1;
}

.session-warning strong {
    display: block;
    margin-bottom: 3px;
}

.session-warning p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
}

/* Header Center Layout */
.header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column; /* Ubah ke column untuk center layout */
    align-items: center; /* Center semua item */
    text-align: center; /* Center text */
    margin-bottom: 30px;
    gap: 15px; /* Jarak antara elemen */
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    justify-content: center; /* Center logo dan text */
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.logo i {
    font-size: 2.5rem;
    color: #3498db;
}

.logo > div {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center children */
    gap: 10px; /* Jarak antara h1 dan user-display */
}

.logo h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    font-weight: 600;
    margin: 0; /* Remove margin */
    text-align: center;
}

.user-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-display i {
    font-size: 1.2rem;
    color: #3498db;
}

#loggedInUser {
    font-weight: 500;
    color: #2c3e50;
}

.btn-logout {
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-logout:hover {
    background: #3498db;
    transform: translateY(-1px);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 10px; /* Add some spacing */
}

.current-time {
    font-size: 0.9rem;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-time i {
    color: #3498db;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header {
        padding: 20px;
        gap: 10px;
    }
    
    .logo {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .user-display {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }
    
    .user-display span {
        order: -1; /* Nama user di atas */
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .user-display {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn-logout {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}