/* =====================================================
   Dermatoloji Kliniği - Custom Styles
   ===================================================== */

:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --info-color: #4299e1;
    --dark-color: #2d3748;
    --light-color: #f7fafc;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --navbar-height: 60px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%) !important;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%) !important;
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%) !important;
}

.bg-gradient-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%) !important;
}

/* Navbar */
.navbar {
    height: var(--navbar-height);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    z-index: 1040;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.sidebar-toggle {
    border: none;
    background: transparent;
    padding: 0.25rem 0.5rem;
    transition: transform var(--transition-speed);
}

.sidebar-toggle:hover {
    transform: scale(1.1);
}

/* Wrapper */
.wrapper {
    display: flex;
    width: 100%;
    padding-top: var(--navbar-height);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-speed) ease;
    z-index: 1030;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-content {
    padding: 1rem 0;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    color: var(--dark-color);
    font-weight: 500;
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.sidebar .nav-link:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, transparent 100%);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar.collapsed .menu-text {
    display: none;
}

.sidebar.collapsed .nav-link {
    padding: 0.875rem;
    justify-content: center;
}

.sidebar.collapsed .nav-link i {
    margin: 0 !important;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--navbar-height));
    transition: margin-left var(--transition-speed) ease;
}

.sidebar.collapsed+.main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Cards */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    color: white;
    padding: 1.5rem;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
}

.stats-card .icon {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.stats-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stats-card p {
    margin: 0;
    opacity: 0.9;
    font-weight: 500;
}

/* Buttons */
.btn {
    border-radius: 10px;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #6b46c1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border: none;
    color: white;
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
    color: white;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    transition: all var(--transition-speed);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* DataTables Styling */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 0.5rem 1rem;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    padding: 0.25rem 2rem 0.25rem 0.5rem;
}

table.dataTable {
    border-collapse: collapse !important;
}

table.dataTable thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 1rem !important;
    font-weight: 600;
    color: var(--dark-color);
}

table.dataTable tbody td {
    padding: 1rem !important;
    vertical-align: middle;
    border-bottom: 1px solid #edf2f7;
}

table.dataTable tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05) !important;
}

/* Calendar Styling */
.fc {
    background: white;
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.fc .fc-toolbar-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.fc .fc-button-primary {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
}

.fc .fc-button-primary:hover {
    background: var(--primary-dark);
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: var(--primary-dark);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.fc .fc-event {
    border-radius: 6px;
    border: none;
    padding: 2px 4px;
    font-size: 0.8rem;
    cursor: grab;
    transition: box-shadow 0.2s, transform 0.15s;
}

.fc .fc-event:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
    z-index: 10 !important;
}

.fc .fc-event:active {
    cursor: grabbing;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    transform: scale(1.02);
}

.fc .fc-daygrid-day-number {
    font-weight: 500;
    padding: 8px;
}

.fc .fc-day-today {
    background: rgba(102, 126, 234, 0.08) !important;
}

/* Resource View - Staff columns */
.fc .fc-resource-header {
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%) !important;
}

.fc .fc-col-header-cell {
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
    border-bottom: 2px solid #e2e8f0;
    padding: 8px 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Resource label cells (staff names) */
.fc .fc-datagrid-cell-main {
    font-weight: 600;
    font-size: 0.85rem;
}

/* Slot labels (time column) - 30min intervals */
.fc .fc-timegrid-slot-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #718096;
    vertical-align: top;
    padding-top: 4px;
}

/* Half-hour slot lines */
.fc .fc-timegrid-slot {
    height: 2.2em;
    border-bottom: 1px solid #edf2f7;
}

.fc .fc-timegrid-slot-minor {
    border-top-style: dotted;
    border-top-color: #f0f0f0;
}

/* Major time slot lines (full hours) */
.fc .fc-timegrid-slot-label-frame {
    text-align: right;
    padding-right: 6px;
}

/* Column separator lines */
.fc td, .fc th {
    border-color: #e8ecf1;
}

/* Staff column borders (vertical) */
.fc .fc-timegrid-col {
    border-right: 2px solid #dee2e6;
}

.fc .fc-timegrid-col:last-child {
    border-right: none;
}

/* Now indicator line */
.fc .fc-timegrid-now-indicator-line {
    border-color: #f56565;
    border-width: 2px;
}

.fc .fc-timegrid-now-indicator-arrow {
    border-color: #f56565;
}

/* Event custom content */
.fc-event-custom {
    line-height: 1.3;
    overflow: hidden;
}

/* Drag mirror (ghost while dragging) */
.fc .fc-event-mirror {
    opacity: 0.65;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

/* Selection highlight */
.fc .fc-highlight {
    background: rgba(102, 126, 234, 0.15) !important;
    border: 2px dashed var(--primary-color);
    border-radius: 4px;
}

/* Resource column header styling */
.fc .fc-resource-header .fc-col-header-cell-cushion,
.fc .fc-datagrid-header {
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4a5568;
}

/* Custom tooltip */
.calendar-tooltip .tooltip-inner {
    max-width: 280px;
    text-align: left;
    white-space: pre-line;
    padding: 8px 12px;
    font-size: 0.8rem;
    background: #2d3748;
    border-radius: 8px;
}

/* Make calendar responsive */
@media (max-width: 767.98px) {
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 8px;
    }

    .fc .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }

    .fc .fc-col-header-cell {
        font-size: 0.7rem;
        padding: 4px 2px;
    }

    .fc .fc-event {
        font-size: 0.7rem;
        padding: 1px 3px;
    }

    .fc .fc-timegrid-slot {
        height: 2em;
    }
}

/* View mode switch styling */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Select2 Styling */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 0.5rem;
    min-height: 48px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    padding-left: 0.5rem;
}

/* Alerts / Toasts */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

/* Page Title */
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: #718096;
    font-size: 1rem;
}

/* Badge */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

/* Appointment Mini Actions */
.apt-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
}

.apt-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-decoration: none;
    opacity: 0.7;
}

.apt-action-link:hover {
    opacity: 1;
    transform: scale(1.15);
}

.apt-action-link.text-success:hover {
    color: #38a169 !important;
}

.apt-action-link.text-primary:hover {
    color: #5a67d8 !important;
}

.apt-action-link.text-danger:hover {
    color: #e53e3e !important;
}

/* Action Buttons */
.action-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin: 2px;
    flex-shrink: 0;
}

/* Action Buttons Container */
td .action-btn {
    vertical-align: middle;
}

table.dataTable td:last-child {
    white-space: nowrap;
    min-width: 200px;
}

/* Responsive action buttons */
@media (max-width: 1200px) {
    .action-btn {
        width: 32px;
        height: 32px;
        margin: 1px;
        font-size: 0.875rem;
    }

    table.dataTable td:last-child {
        min-width: 180px;
    }
}

@media (max-width: 992px) {
    .action-btn {
        width: 28px;
        height: 28px;
        margin: 1px;
        border-radius: 6px;
        font-size: 0.8rem;
    }

    table.dataTable td:last-child {
        min-width: 160px;
    }
}

/* Modal Styling */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #edf2f7;
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid #edf2f7;
    padding: 1rem 1.5rem;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar.collapsed+.main-content {
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    .page-title {
        font-size: 1.5rem;
    }

    .stats-card h3 {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    .action-btn {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 575.98px) {
    .login-card {
        margin: 1rem;
        padding: 2rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

/* Demo Badge */
.demo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    animation: demoPulse 2s ease-in-out infinite;
}

.demo-badge .demo-days {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

@keyframes demoPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 2px 16px rgba(245, 158, 11, 0.6); }
}

/* Demo Expired Banner */
.demo-expired-banner {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.demo-expired-banner a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

/* === Embed mode (iframe içi) === */
html.embed-mode .navbar,
html.embed-mode .tab-bar,
html.embed-mode #sidebar { display: none !important; }
html.embed-mode .wrapper { padding-top: 0 !important; }
html.embed-mode .main-content { margin-left: 0 !important; }

/* === Tab Bar === */
.tab-bar {
    position: fixed;
    top: var(--navbar-height);
    left: var(--sidebar-width);
    right: 0;
    height: 36px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    z-index: 1025;
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    transition: left var(--transition-speed) ease;
}
.sidebar.collapsed ~ .tab-bar,
body.sidebar-collapsed .tab-bar { left: var(--sidebar-collapsed-width); }
.wrapper { padding-top: calc(var(--navbar-height) + 36px) !important; }
.tab-bar-items { display: flex; align-items: center; height: 100%; padding: 0 4px; white-space: nowrap; }
.tab-item {
    display: flex; align-items: center; padding: 4px 10px; height: 30px;
    border-radius: 5px; cursor: pointer; font-size: 0.78rem; font-weight: 500;
    color: #64748b; user-select: none; position: relative;
}
.tab-item:hover { background: #f1f5f9; }
.tab-item.active {
    background: rgba(102,126,234,.12); color: var(--primary-color); font-weight: 600;
}
.tab-item.active::after {
    content:''; position:absolute; bottom:-3px; left:8px; right:8px;
    height:2px; background:var(--primary-color); border-radius:2px;
}
.tab-item-label { display:flex; align-items:center; gap:4px; }
.tab-item-label i { font-size:.8rem; }
.tab-close {
    margin-left:6px; font-size:1rem; line-height:1; color:#94a3b8;
    opacity:0; transition:opacity .15s; padding:0 2px; border-radius:3px;
}
.tab-item:hover .tab-close { opacity:1; }
.tab-close:hover { color:var(--danger-color); }

/* Tab content area (iframes) */
.tab-content-area {
    position: fixed;
    top: calc(var(--navbar-height) + 36px);
    left: var(--sidebar-width);
    right: 0; bottom: 0;
    z-index: 1020;
    transition: left var(--transition-speed) ease;
}
body.sidebar-collapsed .tab-content-area { left: var(--sidebar-collapsed-width); }
.tab-iframe { width:100%; height:100%; border:none; }

@media (max-width:991.98px) {
    .tab-bar, .tab-content-area { left:0; }
    .tab-close { opacity:1; }
}

