/* iPosMeet - HubSpot-style Meeting Scheduler */

:root {
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --navy: #2d3e50;
    --navy-light: #34495e;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--gray-100);
    color: var(--gray-900);
    margin: 0;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* ========================================
   Meeting Scheduler Container
   ======================================== */
.meeting-scheduler {
    display: flex;
    max-width: 820px;
    width: 100%;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    min-height: 520px;
}

/* ========================================
   Left Panel - Agent + Calendar
   ======================================== */
.scheduler-left {
    width: 320px;
    min-width: 320px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.agent-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.agent-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.agent-subtitle {
    font-size: 0.85rem;
    opacity: 0.8;
    margin: 0;
}

/* ========================================
   Mini Calendar
   ======================================== */
.mini-calendar {
    flex: 1;
}

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

.cal-month-year {
    font-size: 1rem;
    font-weight: 600;
    text-transform: capitalize;
}

.cal-nav {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.cal-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 0.5rem;
}

.cal-weekdays span {
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0.6;
    padding: 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.cal-day {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 auto;
    border: none;
    background: transparent;
    color: var(--white);
    padding: 0;
}

.cal-day:hover:not(.disabled):not(.empty) {
    background: rgba(255, 255, 255, 0.25);
}

.cal-day.today {
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.cal-day.selected {
    background: var(--white);
    color: var(--navy);
    font-weight: 700;
}

.cal-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cal-day.empty {
    cursor: default;
}

.cal-day.other-month {
    opacity: 0.3;
}

/* ========================================
   Right Panel - Duration + Slots + Form
   ======================================== */
.scheduler-right {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-height: 600px;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 0.75rem;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

/* Duration Selector */
.duration-selector {
    display: flex;
    gap: 0.5rem;
}

.duration-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 2px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
}

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

.duration-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
}

/* Timezone info */
.timezone-info {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin: 0 0 0.75rem;
}

/* No date message */
.no-date-msg {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    color: var(--gray-400);
    font-size: 0.9rem;
}

/* Time Slots */
.time-slots {
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
}

.time-slots::-webkit-scrollbar {
    width: 4px;
}

.time-slots::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 2px;
}

.time-slots::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

.time-slot-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border: 2px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
}

.time-slot-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(13, 110, 253, 0.04);
}

.time-slot-btn.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
}

/* ========================================
   Back Button
   ======================================== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-bottom: 1rem;
}

.back-btn:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Selected datetime banner */
.selected-datetime-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    background: #eef6ff;
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
}

.selected-datetime-banner svg {
    color: var(--primary);
    flex-shrink: 0;
}

/* ========================================
   Form Styles
   ======================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.35rem;
}

.required {
    color: #ef4444;
}

.form-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--gray-900);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--white);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.form-input::placeholder {
    color: var(--gray-400);
}

textarea.form-input {
    resize: vertical;
    min-height: 70px;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.submit-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

.submit-btn:hover {
    background: var(--primary-dark);
}

.submit-btn:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

/* ========================================
   Navbar (for admin pages)
   ======================================== */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Admin pages styles (cards, tables, etc.)
   ======================================== */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: var(--radius);
}

.card-header {
    border-radius: var(--radius) var(--radius) 0 0;
}

.table {
    font-size: 0.9rem;
}

.table thead th {
    background-color: var(--gray-50);
    font-weight: 600;
    border-bottom: 2px solid var(--gray-200);
}

.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

.btn {
    border-radius: 6px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

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

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

.footer {
    padding: 1rem 0;
    margin-top: auto;
}

.alert {
    border-radius: 6px;
    border: none;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .meeting-scheduler {
        flex-direction: column;
        max-width: 100%;
    }

    .scheduler-left {
        width: 100%;
        min-width: 100%;
        padding: 1.5rem;
    }

    .scheduler-right {
        max-height: none;
    }

    .cal-day {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .duration-selector {
        flex-wrap: wrap;
    }

    .duration-btn {
        flex: none;
        width: calc(33.33% - 0.35rem);
    }
}
