:root {
    --font-size: 14px;
    --accent-color: #4f7dc8;
    --accent-light: rgba(79, 125, 200, 0.15);
    --border-radius: 10px;
    --sidebar-width: 195px;
    --row-height: 78px;
    --col-width: 180px; 
    --border-color: #dde3ed;
    --muted: #5a7290;
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.1, 0.64, 1);
    --ease-decel: cubic-bezier(0.0, 0.0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: var(--font-size);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#root {
    transition: background 0.25s ease, color 0.25s ease;
}

input,
select,
textarea,
.selectable {
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px var(--accent-light);
    outline: none;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button,
.compact-appt-card,
.fab-button,
.day-schedule {
    touch-action: manipulation;
}

button:active,
.compact-appt-card:active,
.fab-button:active,
.ios-scroll-item:active {
    transform: scale(0.95) !important;
    opacity: 0.8 !important;
    transition: transform 0.08s var(--ease-standard), opacity 0.08s ease !important;
}

::-webkit-scrollbar {
    display: none;
}

.app-container {
    display: flex;
    height: 100dvh;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.sidebar {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.26s var(--ease-decel);
    z-index: 10001;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    white-space: nowrap;
    width: var(--sidebar-width);
    will-change: transform;
    background: linear-gradient(to top, #111827 0%, #111827 40%, #0d1321 100%);
}

.sidebar.closed {
    width: 64px;
}

.sidebar.closed .sidebar-text {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.sidebar.closed nav button {
    justify-content: center;
    padding: 13px 0;
    border-left: 3px solid transparent !important;
    border-radius: 8px !important;
    margin: 0 auto;
}

.main-content {
    flex: 1;
    overflow: auto;
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
    animation: fadeIn 0.15s ease;
}

.modal-content {
    background: #fff;
    border-radius: var(--border-radius);
    width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
    animation: slideUp 0.22s var(--ease-spring);
    overflow: hidden;
    will-change: transform;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.two-col > * {
    min-width: 0;
    overflow: hidden;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.mobile-overlay.active {
    display: block;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    border: 1px solid;
    min-height: 52px;
    z-index: 1000;
    position: relative;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.date-nav-btn {
    padding: 8px 12px;
    border-radius: calc(var(--border-radius) - 2px);
    font-weight: 600;
    font-size: 0.85em;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.stat-card {
    padding: 8px 12px;
    border-radius: var(--border-radius);
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: calc(var(--border-radius) - 2px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
}

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

@media (max-width: 900px) {
    :root {
        --font-size: 13px;
    }

    .app-container {
        position: relative;
    }

    .sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100%;
        width: 260px !important;
        transform: translateX(0);
    }

    .sidebar.closed {
        transform: translateX(-100%);
    }

    .sidebar-text {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .sidebar nav button {
        justify-content: flex-start !important;
        padding: 12px 14px !important;
    }

    .mobile-overlay.active {
        display: block;
    }

    .main-content {
        padding: 10px;
        width: 100%;
        margin-left: 0;
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .service-card-grid {
        grid-template-columns: 1fr !important;
    }

    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-height: 88dvh;
        border-radius: 18px 18px 0 0;
        animation: slideUpSheet 0.3s var(--ease-spring);
    }

    .day-column {
        min-width: 140px !important;
    }

    .weekly-grid {
        min-width: 800px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .stat-card {
        padding: 8px 10px !important;
    }

    .stat-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.9em !important;
    }

    .top-header {
        flex-wrap: nowrap !important;
        padding: 6px 8px !important;
        gap: 4px !important;
        min-height: 46px !important;
        margin-bottom: 10px !important;
    }

    .fab-button {
        bottom: 20px !important;
        right: 16px !important;
        padding: 12px 20px !important;
        font-size: 0.88em !important;
    }

    .day-column-header {
        font-size: 0.82em !important;
        padding: 5px 4px !important;
    }

    .compact-appt-card {
        padding: 2px 4px !important;
    }

    .ios-scroll-item {
        padding: 5px 8px;
        font-size: 0.8em;
    }

    .stat-card {
        padding: 6px 8px !important;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size: 12px;
    }

    .main-content {
        padding: 6px;
    }

    .top-header {
        padding: 4px 6px !important;
        gap: 3px !important;
        min-height: 40px !important;
        margin-bottom: 8px !important;
    }

    .modal-content {
        max-height: 90dvh;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        margin-bottom: 8px !important;
    }

    .stat-card {
        padding: 7px 9px !important;
    }

    .stat-icon {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.8em !important;
    }

    .fab-button {
        bottom: 16px !important;
        right: 12px !important;
        padding: 11px 18px !important;
        font-size: 0.84em !important;
    }

    .ios-scroll-item {
        padding: 4px 7px;
        font-size: 0.77em;
    }

    .day-column-header {
        font-size: 0.75em !important;
        padding: 4px 2px !important;
    }

    .compact-appt-card {
        padding: 1px 3px !important;
    }

    .compact-appt-card .appt-name {
        font-size: 0.75em !important;
    }

    .two-col {
        grid-template-columns: 1fr !important;
    }

    .dialog-box {
        padding: 18px 16px 14px !important;
        max-width: 320px !important;
    }
}

.weekly-grid-container {
    overflow-x: auto;
    overflow-y: auto;
    min-height: 0;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

.weekly-grid {
    display: flex;
    width: 100%;
    min-width: max-content;
}

.day-column {
    flex: 1;
    min-width: var(--col-width);
    border-right: 1.5px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.day-column:last-child {
    border-right: none;
}

.day-column-header {
    padding: 8px;
    text-align: center;
    font-weight: 700;
    border-bottom: 1px solid;
    position: sticky;
    top: 0;
    z-index: 25;
    font-size: 0.95em;
}

.day-schedule {
    display: flex;
    flex-direction: column;
    contain: layout style;
}

.hour-slot {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border-color);
    z-index: 1;
    pointer-events: auto;
    height: var(--row-height) !important;
    cursor: pointer;
    will-change: transform;
}

.hour-label {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 0.7em;
    font-weight: 700;
    color: var(--muted);
    background: var(--bg-color);
    padding: 0 4px;
    z-index: 5;
    pointer-events: none;
    border-radius: 4px;
}

.compact-appt-card {
    z-index: 10;
    border-radius: 4px;
    left: 40px;
    right: 2px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    box-sizing: border-box;
    padding: 2px 6px;
}

.compact-appt-card:hover {
    filter: brightness(0.92);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
    z-index: 18 !important;
    transform: scale(1.015);
}

.compact-appt-card.status-iptal {
    text-decoration: line-through;
    opacity: 0.6 !important;
}

.ios-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.ios-scroll-container::-webkit-scrollbar {
    display: none;
}

.ios-scroll-item {
    scroll-snap-align: center;
    padding: 5px 9px;
    border-radius: var(--border-radius);
    border: 1px solid;
    font-weight: 700;
    font-size: 0.82em;
    cursor: pointer;
    transition: background 0.18s var(--ease-standard),
                color 0.18s var(--ease-standard),
                border-color 0.18s var(--ease-standard),
                transform 0.15s var(--ease-spring),
                box-shadow 0.18s var(--ease-standard);
    white-space: nowrap;
    flex-shrink: 0;
}

.ios-scroll-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    flex-shrink: 0;
}

/* ── FAB Butonu (Yeni Randevu) ───────────────── */
.fab-button {
    position: fixed;
    bottom: 28px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 14px 24px;
    border-radius: 100px;
    background: var(--accent-color);
    color: white;
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18), 0 1px 4px rgba(0, 0, 0, 0.10);
    z-index: 100;
    transition: transform 0.2s var(--ease-spring),
                box-shadow 0.2s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.fab-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20), 0 2px 6px rgba(0, 0, 0, 0.10);
}

/* ── Dialog (Onay / Uyarı) ───────────────────── */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}

.dialog-box {
    border-radius: var(--border-radius);
    border: 1px solid;
    padding: 28px 24px 20px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: slideUp 0.2s var(--ease-spring);
    text-align: center;
}

/* ── Idle (Uyku) Overlay ─────────────────────── */
.idle-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99990;
    padding: 20px;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.3s ease;
}

.idle-content {
    border-radius: var(--border-radius);
    border: 1px solid;
    padding: 36px 28px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideUp 0.25s var(--ease-spring);
}

.idle-content h3 {
    font-size: 1.3em;
    font-weight: 800;
    margin-bottom: 10px;
}

.idle-content p {
    font-size: 0.9em;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ── Yükleme Ekranı ──────────────────────────── */
@keyframes rLoaderSweep {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(150%);
    }
}

.loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: loadFadeIn 0.4s ease;
}

.loading-logo {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    animation: loadLogoPulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 0.82em;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted, #5a7290);
    opacity: 0.7;
    animation: loadTextFade 1.8s ease-in-out infinite;
}

@keyframes loadLogoPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 16px 48px rgba(79, 125, 200, 0.28);
    }
}

@keyframes loadTextFade {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.95; }
}

@keyframes loadFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Takvim: Anlık Saat Çizgisi ──────────────── */
.current-time-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
    pointer-events: none;
    z-index: 20;
}

.current-time-dot {
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}

/* ── Bell Panel Animasyonları ────────────────── */
@keyframes bellPanelIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bellPanelOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }
}

/* ── Login Ekranı Animasyonları ─────────────── */
@keyframes loginFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes loginSlideUp {
    from {
        transform: translateY(16px) scale(0.97);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes loginShake {
    0%, 100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-5px);
    }
    40% {
        transform: translateX(5px);
    }
    60% {
        transform: translateX(-3px);
    }
    80% {
        transform: translateX(3px);
    }
}

@keyframes loginSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ── Bildirim Paneli: Randevu Kartları ─────────────── */
.reminder-card:hover {
        background: var(--accent-light) !important;
}

.reminder-card button:active {
    transform: scale(0.88) !important;
    opacity: 0.85 !important;
}

.reminder-card button:hover {
    filter: brightness(0.94);
}

/* Bildirim paneli scroll bar özelleştirmesi */
.reminder-card::-webkit-scrollbar,
[style*="overflow-y: auto"]::-webkit-scrollbar {
    width: 6px;
}

[style*="overflow-y: auto"]::-webkit-scrollbar-track {
    background: transparent;
}

[style*="overflow-y: auto"]::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

[style*="overflow-y: auto"]::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* ── Yedekleme Preview Modalları ─────────────── */
.backup-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.backup-preview-grid > div {
    transition: transform 0.15s var(--ease-spring), box-shadow 0.15s ease;
}

.backup-preview-grid > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.backup-preview-grid > div > div:last-child {
    transition: transform 0.2s var(--ease-spring);
}

.backup-preview-grid > div:hover > div:last-child {
    transform: scale(1.08);
}

@media (max-width: 480px) {
    .backup-preview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .backup-preview-grid > div {
        padding: 12px 10px !important;
    }
    .backup-preview-grid > div > div:last-child {
        font-size: 1.3em !important;
    }
}

/* Diff satırları için smooth geçiş */
.backup-diff-row {
    transition: background 0.15s ease, border-color 0.15s ease;
}

.backup-diff-row:hover {
    filter: brightness(0.97);
}

/* Pulse animasyonu (sayılar için) */
@keyframes previewPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Loading overlay smooth fade */
[style*="position: fixed"][style*="z-index: 99998"] {
    animation: fadeIn 0.2s ease;
}

/* Modal içindeki scroll bar özelleştirmesi (yedekleme preview için) */
.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-track {
    background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* ── Sidebar: Sekmeler Arası İnce Ayırıcı Çizgi ───── */
.sidebar-divider {
    width: 40%;
    height: 1px;
    margin: 2px auto;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    pointer-events: none;
}

/* Sidebar closed durumunda divider'ları gizle */
.sidebar.closed .sidebar-divider {
    display: none;
}

/* ── Dark Mode Sidebar Gradyan (aşağıdan yukarıya) ── */
@media (prefers-color-scheme: dark) {
    .sidebar {
        background: linear-gradient(to top, #080e18 0%, #080e18 40%, #050911 100%);
    }
    .sidebar-divider {
        background: rgba(255, 255, 255, 0.06);
    }
}
