/* Genel Stiller */
body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #202124;
}

/* Kart Gölgeleri */
.mud-card {
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.mud-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Buton İyileştirmeleri */
.mud-button-root {
    border-radius: 8px !important;
    font-weight: 500;
}

/* Modal / Dialog */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    backdrop-filter: blur(2px);
}
.modal-dialog {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    background: white;
    padding: 24px;
    border-radius: 12px;
    z-index: 2001;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: modalIn 0.25s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translate(-50%,-50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}
.modal-dialog h4 {
    margin: 0;
    color: #1a73e8;
    font-size: 1.2rem;
}

/* Form Alanları */
.form-control, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    background: #fff;
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}
.form-group {
    margin-bottom: 12px;
}
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: #5f6368;
    font-size: 13px;
}

/* Butonlar */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.btn:hover {
    filter: brightness(0.95);
}
.btn-primary { background: #1a73e8; color: white; }
.btn-danger { background: #ea4335; color: white; }
.btn-secondary { background: #e8eaed; color: #3c4043; }
.btn-success { background: #34a853; color: white; }
.btn-warning { background: #fbbc04; color: #202124; }

/* Randevu Takvimi */
.calendar { font-family: 'Segoe UI', sans-serif; }
.controls { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.controls select, .controls button { padding: 8px 12px; border: 1px solid #dadce0; border-radius: 8px; font-size: 14px; background: white; }
.controls button { background: #1a73e8; color: white; border: none; cursor: pointer; font-weight: 500; }
.controls button:hover { background: #1557b0; }

.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weekday-header { text-align: center; font-weight: 600; padding: 8px; background: #f1f3f4; border-radius: 6px; font-size: 13px; color: #5f6368; }

.days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 4px; }
.day-cell { min-height: 90px; border: 1px solid #e8eaed; border-radius: 8px; padding: 6px; background: #ffffff; cursor: pointer; transition: all 0.2s ease; }
.day-cell:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); border-color: #1a73e8; }
.day-cell.today { background: #e8f0fe; border-color: #1a73e8; }
.day-number { font-weight: 600; margin-bottom: 4px; color: #202124; }

.appt-item { display: flex; align-items: center; gap: 5px; margin: 2px 0; padding: 4px 6px; border-radius: 6px; background: #f8f9fa; font-size: 11px; cursor: pointer; transition: all 0.2s ease; border: 1px solid #e8eaed; }
.appt-item:hover { transform: translateX(2px); background: #e8f0fe; border-color: #1a73e8; }
.status-bar { width: 4px; height: 100%; min-height: 20px; border-radius: 2px; flex-shrink: 0; }

/* Responsive */
@media (max-width: 768px) {
    .day-cell { min-height: 60px; padding: 3px; }
    .day-cell .day-number { font-size: 12px; }
    .appt-item { font-size: 9px; padding: 2px 4px; }
    .modal-dialog { width: 95%; padding: 16px; }
    .controls { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
    .mud-container { padding-left: 8px; padding-right: 8px; }
    .weekday-header { font-size: 10px; padding: 4px; }
}

/* ═══════════════════════════════════════════
   MOBİL UYUM — Genel responsive düzeltmeler
   ═══════════════════════════════════════════ */

/* Tablo overflow — dar ekranda yatay kaydır */
.report-table, .mud-table-root {
    min-width: 500px;
}
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* MudBlazor kart içerikleri dar ekranda dolu genişlik */
@media (max-width: 600px) {
    .mud-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* 2-kolon grid'leri mobilde tek kolon */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* 4-kolon stat kartları → 2 kolon */
    [style*="grid-template-columns:repeat(4,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Sabit yükseklikli çizgiler azalt */
    .mud-appbar {
        height: auto !important;
        min-height: 56px;
    }

    /* Form inputları — iOS zoom önleme */
    input, select, textarea {
        font-size: 16px !important;
    }

    /* Buton metinleri taşmasın */
    .mud-button-label {
        white-space: normal;
    }
}

@media (max-width: 480px) {
    /* Dashboard iki kolon → tek kolon */
    [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .currency-bar { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   ADAPTIVE MODAL — Tüm sayfalardaki modallere uygulanır
   ═══════════════════════════════════════════════════════════ */

/* Modal arka plan */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
}

/* Modal kutu — adaptive */
.modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);

    /* Adaptive boyutlar */
    width: min(560px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    overflow-x: hidden;

    /* Scroll davranışı */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.modal-dialog::-webkit-scrollbar { width: 6px; }
.modal-dialog::-webkit-scrollbar-track { background: transparent; }
.modal-dialog::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

/* Küçük ekranda modal — neredeyse tam ekran */
@media (max-width: 600px) {
    .modal-dialog {
        width: 96vw;
        max-height: 92vh;
        padding: 18px 16px;
        border-radius: 14px;
        top: 50%;
        transform: translate(-50%, -50%);
    }
}

/* MudDialog da adaptive olsun */
.mud-dialog {
    max-height: 88vh !important;
    overflow-y: auto !important;
}

.mud-dialog-content {
    overflow-y: auto !important;
    max-height: calc(88vh - 120px) !important;
}

/* Sabit genişlikli inline modaller (position:fixed kullananlar) */
[style*="position:fixed"][style*="top:50%"] > div,
[style*="position:fixed"][style*="top: 50%"] > div {
    max-height: 88vh !important;
    overflow-y: auto !important;
    width: min(var(--modal-width, 520px), 92vw) !important;
}

/* ═══════════════════════════════════════════════════════════
   İLETİŞİM BUTONLARI — E-posta / WhatsApp / SMS
   ═══════════════════════════════════════════════════════════ */
.comm-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.comm-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.comm-btn:active { transform: translateY(0); }

.comm-email {
    background: #1565C0;
    color: white;
}
.comm-whatsapp {
    background: #25D366;
    color: white;
}
.comm-sms {
    background: #E65100;
    color: white;
}

@media (max-width: 600px) {
    .comm-btn { padding: 8px 12px; font-size: 13px; }
}
