:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --bg-gradient-1: #f1f5f9;
    --bg-gradient-2: #f8fafc;
    --text-main: #0f172a;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    --input-bg: rgba(255, 255, 255, 0.9);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-gradient-2);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

body.dashboard-layout {
    align-items: flex-start !important;
    padding-top: 4rem !important;
}

/* Background Blobs */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    background: #f8fafc;
}

.blob-1 {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    max-width: 600px;
    max-height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.4) 0%, rgba(79, 70, 229, 0) 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: blobAnimation 20s infinite alternate ease-in-out;
}

.blob-2 {
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    max-width: 700px;
    max-height: 700px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, rgba(16, 185, 129, 0) 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: blobAnimation 25s infinite alternate-reverse ease-in-out;
}

@keyframes blobAnimation {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 10%) scale(1.2); }
}

.text-gradient {
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.app-container {
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.8s ease-out;
    position: relative;
    z-index: 1;
}

.hero {
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--secondary), #34d399);
    border-radius: 8px;
    position: relative;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.logo-icon::after {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease;
}

.glass-card h2 {
    margin-bottom: 2rem;
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

input, select, textarea {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    color-scheme: light;
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

input::placeholder {
    color: #64748b;
}

select option {
    background: #fff;
    color: var(--text-main);
}

small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 99px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-outline {
    width: 100%;
    padding: 1rem;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    white-space: nowrap;
}

.btn-outline:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 99px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: translateY(0);
    box-shadow: none;
}

.btn-outline-sm {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline-sm:hover {
    background: rgba(0,0,0,0.05);
}


.hidden {
    display: none !important;
}

#success-message {
    text-align: center;
    animation: fadeInScale 0.5s ease-out;
}

.success-icon-animated {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #fff;
    stroke-miterlimit: 10;
    margin: 10% auto;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}
@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}
@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 50px #10b981;
    }
}

#success-message h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

#success-message p {
    color: var(--text-muted);
    line-height: 1.5;
}

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

/* Summary UI */
.summary-card {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.summary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.summary-value {
    color: var(--text-main);
    font-weight: 500;
    font-size: 1rem;
}

/* WhatsApp Mock Toast */
.wa-toast {
    position: fixed;
    top: 20px;
    right: -400px;
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wa-toast.show {
    right: 20px;
}

.wa-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.wa-header span {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
}

.wa-header small {
    margin-left: auto;
    color: var(--text-muted);
}

.wa-body {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.wa-body b {
    color: var(--text-main);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Calendar UI */
.calendar-container {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-main);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    text-align: center;
}

.days-header {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.calendar-day {
    padding: 0.5rem 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.calendar-day:hover:not(.disabled) {
    background: rgba(0, 0, 0, 0.05);
}

.calendar-day.disabled {
    color: rgba(0, 0, 0, 0.2);
    cursor: not-allowed;
}

.calendar-day.selected {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
}

.time-slot {
    padding: 0.75rem 0;
    text-align: center;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.time-slot:hover {
    background: rgba(0, 0, 0, 0.05);
}

.time-slot.selected {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
    font-weight: 600;
}

/* Time Chips Styles */
.time-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    min-height: 32px;
}
.time-chip {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.time-chip.disabled {
    background: var(--text-muted);
    opacity: 0.6;
}
.time-chip-remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
}
.time-chip-remove:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    /* Base spacing adjustments */
    body {
        padding: 0 !important;
    }
    body.dashboard-layout {
        padding-top: 0.5rem !important;
    }
    .app-container, .main-content {
        padding: 0.5rem !important;
        padding-top: 1.5rem !important;
        gap: 0.5rem;
        justify-content: flex-start !important;
    }
    .auth-container {
        padding: 0.5rem !important;
        padding-top: 1.5rem !important;
        justify-content: flex-start !important;
    }

    /* Header and navigation */
    .dashboard-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
        padding: 0.5rem;
    }
    .dashboard-header > div:last-child {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }
    .dashboard-header .btn-primary, .dashboard-header .btn-outline {
        width: 100%;
        justify-content: center;
    }

    /* Admin Layout tweaks */
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.1);
        padding: 1rem 0.5rem;
    }
    .sidebar nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        white-space: nowrap;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar nav .nav-item {
        margin-bottom: 0;
    }

    /* Cards and Grids */
    .form-row {
        grid-template-columns: 1fr !important;
    }
    .glass-card {
        padding: 1.5rem 1rem !important;
        margin: 0 !important;
    }
    .summary-grid {
        grid-template-columns: 1fr;
    }

    /* Tables */
    table {
        width: 100%;
        white-space: nowrap;
        border-radius: 8px;
    }
    th, td {
        padding: 0.75rem 0.5rem !important;
    }

    /* Auth pages */
    .auth-card {
        margin: 0 !important;
        padding: 2rem 1.25rem !important;
        border-radius: 16px !important;
    }
}

/* Logo Wrapper - 'by dr-eko.com' branding */
.logo-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
.logo-wrapper img {
    display: block;
}
.logo-by {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.02em;
    margin-top: -2px;
}
.logo-by a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 700;
}
.logo-by a:hover {
    text-decoration: underline;
}


/* Custom Calendar Admin Colors */
.calendar-day.active-day { color: #198754; background: rgba(25, 135, 84, 0.1); }
.calendar-day.active-day:hover { background: rgba(25, 135, 84, 0.3); }
.calendar-day.inactive-day { color: #dc3545; background: rgba(220, 53, 69, 0.05); }
.calendar-day.inactive-day.disabled:hover { background: rgba(220, 53, 69, 0.05); cursor: not-allowed; }


/* --- Mobile Sidebar Fixes --- */
@media (max-width: 768px) {
    body {
        flex-direction: row !important;
        overflow-x: hidden;
    }
    .sidebar {
        position: fixed !important;
        left: -280px !important;
        top: 0;
        bottom: 0;
        width: 260px !important;
        z-index: 1050;
        transition: left 0.3s ease !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border-right: 1px solid rgba(0,0,0,0.1) !important;
        padding: 2rem 1rem !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1) !important;
        height: 100vh;
        overflow-y: auto;
    }
    .sidebar.open {
        left: 0 !important;
    }
    .sidebar nav {
        flex-direction: column !important;
        white-space: normal !important;
    }
    .sidebar nav .nav-item {
        margin-bottom: 0.5rem !important;
        display: block !important;
        width: 100%;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        backdrop-filter: blur(2px);
    }
    .sidebar-overlay.open {
        display: block;
    }
    
    .hamburger-btn {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw;
        padding: 1rem !important;
        min-width: 0 !important;
    }
    
    .glass-card {
        overflow-x: auto !important;
    }
    
    table {
        white-space: nowrap;
    }
}
