:root {
    /* Base Colors - Dusty Pink Theme */
    --primary-color: #d88c9a;
    /* Toz Pembe */
    --primary-hover: #c47685;

    /* Default Dark Theme Variables */
    --bg-color: #1a1a1a;
    --surface-color: #252525;
    --text-color: #f4f4f4;
    --text-muted: #cccccc;
    --border-color: #333;
    --overlay-color: rgba(0, 0, 0, 0.7);
    --header-bg: rgba(26, 26, 26, 0.95);

    --transition: all 0.3s ease;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-color: #f9f5ea;
    /* Soft Beige */
    --surface-color: #ffffff;
    /* White cards */
    --text-color: #4a3b32;
    /* Dark Brownish Gray */
    --text-muted: #8c7b75;
    --border-color: #e6dace;
    --overlay-color: rgba(249, 245, 234, 0.9);
    --header-bg: rgba(249, 245, 234, 0.95);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

main {
    padding-top: 120px;
}

/* Header & Navigation */
header {
    background: var(--header-bg);
    padding: 1rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(216, 140, 154, 0.2);
    transition: background 0.3s;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    transition: var(--transition);
}

.logo:hover img {
    transform: scale(1.05);
}

nav {
    display: flex;
    align-items: center;
}

/* ... existing ... */

/* Mobile Menu Button - Ensure Visibility */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 0;
    /* Remove right margin to align right */
    padding: 0.5rem;
    z-index: 1001;
}

/* ... */

/* RESPONSIVE MEDIA QUERIES */

/* Tablet & Mobile */
@media (max-width: 992px) {
    /* ... existing ... */

    /* Fix Admin Sidebar Height and Scrolling */
    .sidebar {
        left: -250px;
        height: 100vh;
        /* Fallback */
        height: 100dvh;
        /* Dynamic viewport height */
        padding-bottom: 5rem;
        /* Ensure bottom items are reachable */
    }

    /* ... */
}

/* Mobile */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1002;
    }

    /* Ensure nav is visible to hold the button, but doesn't block it */
    nav {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        width: auto;
        position: static;
        /* Let header handle relative positioning context if needed */
    }

    /* Fix Calendar/Appointment Header on Mobile */
    .fc-header-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }
}


nav ul {
    display: flex;
    list-style: none;
    align-items: center;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--primary-color);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1rem;
}

.theme-toggle-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Hero Section */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../images/arkaplan.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #f4f4f4;
    /* Always light for dark background */
    font-weight: 500;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    border: 2px solid var(--primary-color);
    transition: var(--transition);
    cursor: pointer;
}

.btn:hover {
    background: transparent;
    color: var(--primary-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Sections */
section {
    padding: 5rem 5%;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-muted);
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--surface-color);
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
    transition: var(--transition);
    border: 1px solid transparent;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.service-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.service-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 4px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Steps */
.step {
    color: var(--text-muted);
    font-weight: bold;
}

.step.active {
    color: var(--primary-color);
}

/* Summary Box */
#summary-content {
    background: var(--surface-color) !important;
    color: var(--text-color);
}

/* Mobile Specific Fixes */
@media (max-width: 768px) {

    /* Hero Buttons Spacing */
    .hero-content .btn {
        margin-bottom: 1rem;
        width: 100%;
        /* Make buttons full width for better touch */
        box-sizing: border-box;
    }

    .hero-content .btn-outline {
        width: 100%;
        box-sizing: border-box;
    }
}

/* Footer */
footer {
    background: #111;
    /* Footer usually stays dark */
    padding: 3rem 5%;
    text-align: center;
    border-top: 1px solid rgba(216, 140, 154, 0.2);
}

footer p {
    color: #888;
}

/* Theme Utilities */
.theme-text-primary {
    color: var(--primary-color) !important;
}

.theme-bg-surface {
    background: var(--surface-color) !important;
    transition: background-color 0.3s;
}

.placeholder-box {
    background: var(--surface-color);
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s, border-color 0.3s;
}

/* ADMIN PANEL STYLES */
.admin-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    /* For absolute positioning of toggle btn if needed */
}

.sidebar {
    width: 250px;
    background: #111;
    padding: 2rem;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    top: 0;
    left: 0;
    z-index: 1100;
    /* Higher than header */
    transition: left 0.3s ease;
}

.sidebar h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.sidebar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sidebar li {
    margin-bottom: 1rem;
}

.sidebar li:last-child {
    margin-bottom: 0;
}

.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: 250px;
    background: var(--bg-color);
    transition: margin-left 0.3s ease;
}

.card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

/* Admin Tables (Mobile Responsive) */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    display: table;
    /* Default */
}

/* Wrapper for horizontal scroll on mobile */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 1rem;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    white-space: nowrap;
    /* Prevent wrapping in cells, forces scroll */
}

th {
    background: #333;
    color: var(--primary-color);
}

tr:last-child td {
    border-bottom: none;
}

/* Admin Buttons */
.btn-delete {
    background: #dc3545;
}

.btn-edit {
    background: #007bff;
}

.btn-action {
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-right: 5px;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-number {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.badge-warning {
    background: #ffc107;
    color: #000;
}

.badge-success {
    background: #28a745;
    color: #fff;
}

.btn-approve {
    background: #28a745;
}

.btn-reject {
    background: #dc3545;
}

/* Mobile Tweaks */
@media (max-width: 768px) {

    /* Fix Calendar Buttons */
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 1rem;
    }

    .fc .fc-toolbar-title {
        font-size: 1.2rem !important;
    }

    .fc .fc-button {
        font-size: 0.8rem !important;
        padding: 4px 8px !important;
    }

    /* Fix Form Inputs */
    .form-control {
        font-size: 16px;
        /* Prevents iOS zoom on focus */
    }
}

/* Admin Toggle Button (Added via JS) */
.admin-toggle-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1050;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: none;
    /* Hidden on desktop */
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none;
}

.admin-overlay.active {
    display: block;
}

/* RESPONSIVE MEDIA QUERIES */

/* Tablet & Mobile */
@media (max-width: 992px) {

    /* Admin Sidebar */
    .sidebar {
        left: -250px;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding-top: 9rem;
        /* Further increased space (was 7.5rem) to avoid hamburger overlap */
        /* Side padding removed - calendar needs full width */
    }

    .admin-toggle-btn {
        display: block;
    }

    /* Force tables to scroll */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Mobile */
@media (max-width: 768px) {

    /* Public Site Header */
    .mobile-menu-btn {
        display: block;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--surface-color);
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }

    nav ul.active {
        display: flex;
    }

    nav ul li {
        margin: 0;
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
    }

    nav ul li a {
        display: block;
        padding: 0.5rem;
    }

    /* Center theme toggle button on mobile */
    .theme-toggle-btn {
        margin: 0 auto;
    }

    /* Hero */
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    /* Sections */
    section {
        padding: 3rem 5%;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    /* Admin forms */
    .admin-container {
        flex-direction: column;
    }

    .card {
        padding: 1.5rem;
    }

    /* Make form grids stack */
    form div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}