/* Also hide the fixed footer and remove bottom padding when schedule is active */
body.schedule-view-active .dashboard-footer {
    display: none !important;
}

body.schedule-view-active .main-content {
    padding: 0 !important;
    overflow: hidden !important;
    height: calc(100vh - 60px) !important;
}

/* #view-schedule must fill the full height of .main-content */
#view-schedule {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 60px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/* Appointy Theme for Schedule Tab */

/* ============================================================
   EDGE-TO-EDGE OVERRIDE
   When the schedule view is active, strip padding from
   .main-content so the plugin fills the full canvas.
   The JS adds .schedule-view-active to <body>.
   ============================================================ */
body.schedule-view-active .main-content {
    padding: 0 !important;
    overflow: hidden !important;
}

/* The outer dashboard-view container for schedule */
#view-schedule {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* The mount point created by schedule-tab-view.js */
#view-schedule .schedule-tab-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* The plugin-view div assigned by SchedulePlugin.initialize() */
#view-schedule .plugin-view {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex !important;
    flex-direction: row;
}

/* ============================================================
   APPOINTY INNER LAYOUT
   ============================================================ */

.appointy-layout {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ── Inner Sidebar ────────────────────────────────────────── */
.appointy-sidebar {
    width: 56px;
    min-width: 56px;
    background-color: #1e1f2b;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 8px;
    z-index: 10;
    box-shadow: 2px 0 6px rgba(0,0,0,0.3);
}

.appointy-icon-btn {
    width: 56px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    font-size: 17px;
    transition: all 0.15s;
    background: transparent;
    border: none;
    outline: none;
    position: relative;
}

.appointy-icon-btn:hover {
    color: #fff;
    background-color: rgba(0,0,0,0.12);
}

.appointy-icon-btn.active {
    color: #fff;
    background-color: rgba(0,0,0,0.2);
    border-left: 3px solid #f39c12;
}

/* ── Main Content Area ───────────────────────────────────── */
.appointy-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: #1a1a1a;
}

/* ── Today View ──────────────────────────────────────────── */
.appointy-today-view {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
        url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.today-view-date {
    position: absolute;
    top: 20px;
    right: 28px;
    text-align: right;
}

.today-view-date .date-small {
    font-size: 11px;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.today-view-date .date-large {
    font-size: 22px;
    color: #fff;
    font-weight: 300;
    letter-spacing: 2px;
}

.today-view-center {
    text-align: center;
}

.today-view-center h1 {
    font-size: 32px;
    color: #fff;
    font-weight: 300;
    margin-bottom: 10px;
}

.today-view-center p {
    font-size: 13px;
    color: #bbb;
    margin-bottom: 22px;
}

.add-appointment-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    padding: 8px 18px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.add-appointment-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
}

/* ── Calendar Top Header ─────────────────────────────────── */
.appointy-calendar-header {
    height: 50px;
    min-height: 50px;
    background-color: #161616;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid #2a2a2a;
    z-index: 10;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #2b8496;
    font-size: 13px;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-arrow {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    padding: 0;
    transition: all 0.15s;
}

.nav-arrow:hover {
    color: #2b8496;
    border-color: #2b8496;
}

.staff-dropdown-btn {
    background: #222;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
}

.staff-dropdown-btn:hover {
    border-color: #2b8496;
}

.staff-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 4px;
    min-width: 140px;
    z-index: 200;
    display: none;
    box-shadow: 0 6px 16px rgba(0,0,0,0.6);
}

.staff-dropdown-menu.active {
    display: block;
}

.dropdown-item {
    padding: 10px 16px;
    font-size: 13px;
    color: #2b8496;
    cursor: pointer;
    transition: background 0.1s;
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid #2a2a2a;
}

.dropdown-item:hover {
    background: #2a2a2a;
}

/* ── Grid Wrapper (scrollable body) ─────────────────────── */
.appointy-grid-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
}

/* ── Grid Header (day names) ─────────────────────────────── */
.grid-header {
    display: flex;
    border-bottom: 1px solid #2a2a2a;
    position: sticky;
    top: 0;
    background: #161616;
    z-index: 5;
    flex-shrink: 0;
}

.time-axis-spacer {
    width: 100px;
    min-width: 100px;
    border-right: 1px solid #2a2a2a;
}

.day-header {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    border-right: 1px solid #2a2a2a;
    font-size: 11px;
    color: #888;
    min-width: 0;
}

.day-header .day-name {
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.day-header .day-date {
    font-size: 16px;
    color: #e0e0e0;
    font-weight: 400;
}

/* ── Grid Body ───────────────────────────────────────────── */
.grid-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.time-axis {
    width: 100px;
    min-width: 100px;
    border-right: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.time-slot-label {
    height: 120px;
    position: relative;
    border-bottom: 1px solid #222;
    flex-shrink: 0;
}

.time-slot-label > span {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    font-size: 36px;
    font-weight: 300;
    color: #ccc;
    line-height: 1;
}

.time-slot-label .am-pm {
    position: absolute;
    top: calc(50% + 26px);
    left: 14px;
    transform: translateY(-50%);
    font-size: 11px;
    color: #d35400;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.time-slot-label .minutes {
    position: absolute;
    right: 6px;
    top: 0;
    bottom: 0;
    width: 20px;
}

.time-slot-label .minutes div {
    position: absolute;
    right: 0;
    font-size: 9px;
    color: #555;
    line-height: 1;
}

.time-slot-label .minutes div:nth-child(1) { top: 25%; transform: translateY(-50%); }
.time-slot-label .minutes div:nth-child(2) { top: 50%; transform: translateY(-50%); }
.time-slot-label .minutes div:nth-child(3) { top: 75%; transform: translateY(-50%); }

/* ── Day Columns ─────────────────────────────────────────── */
.day-column {
    flex: 1;
    border-right: 1px solid #2a2a2a;
    position: relative;
    background: #1a1a1a;
    min-width: 0;
    cursor: pointer;
    height: 2880px; /* 24 hours * 120px per hour */
    /* Horizontal grid lines: solid every 120px (1 hour), faint every 30px (15 min) */
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 29px,
            rgba(255,255,255,0.03) 29px,
            rgba(255,255,255,0.03) 30px
        ),
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 119px,
            #2a2a2a 119px,
            #2a2a2a 120px
        );
}

.day-hover-highlight {
    position: absolute;
    left: 0;
    right: 0;
    height: 30px;
    background-color: rgba(211, 84, 0, 0.12); /* Appointy semi-transparent orange */
    border-top: 1px solid rgba(211, 84, 0, 0.25);
    border-bottom: 1px solid rgba(211, 84, 0, 0.25);
    pointer-events: none; /* Passes mouse events straight through to col */
    display: none;
    align-items: center;
    justify-content: center;
    color: #e67e22;
    font-size: 11px;
    font-weight: 600;
    z-index: 5;
}

/* Diagonal stripes for unavailable times (past) */
.day-column.unavailable {
    background-image:
        repeating-linear-gradient(
            45deg,
            #1a1a1a,
            #1a1a1a 10px,
            #1f1f1f 10px,
            #1f1f1f 20px
        ),
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 119px,
            #242424 119px,
            #242424 120px
        );
}

/* ── Schedule Event Blocks ───────────────────────────────── */
.schedule-block {
    position: absolute;
    left: 3px;
    right: 3px;
    background: linear-gradient(135deg, #2b8496, #1a6070);
    border-left: 3px solid #5bc0d6;
    border-radius: 3px;
    padding: 5px 7px;
    font-size: 11px;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: filter 0.15s;
}

.schedule-block:hover {
    filter: brightness(1.15);
}

/* ── Month View ──────────────────────────────────────────── */
.schedule-month-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 16px;
    color: #e0e0e0;
}

.schedule-month-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 4px;
}

.schedule-month-header {
    text-align: center;
    padding: 8px;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.schedule-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #2a2a2a;
    border: 1px solid #2a2a2a;
}

.schedule-month-day {
    background: #1a1a1a;
    min-height: 90px;
    padding: 8px;
    cursor: pointer;
    transition: background 0.1s;
}

.schedule-month-day:hover { background: #222; }
.schedule-month-day.today { background: #1e2c30; border-top: 2px solid #2b8496; }
.schedule-month-day.past { opacity: 0.5; }
.schedule-month-day.empty { background: #151515; cursor: default; }

.schedule-month-day-number {
    font-size: 13px;
    color: #ccc;
    margin-bottom: 4px;
}

.schedule-month-day.today .schedule-month-day-number {
    color: #2b8496;
    font-weight: 700;
}

.schedule-month-item {
    background: #2b8496;
    border-radius: 2px;
    padding: 2px 5px;
    font-size: 10px;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-month-more {
    font-size: 10px;
    color: #888;
    padding: 2px 5px;
}

/* Service Scheduling Modal (Appointy Theme) */
.service-scheduling-modal {
    background: #23253b; /* Theme Purple */
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    width: min(900px, 95vw);
    max-height: 90vh;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    position: relative; /* For sliding panel */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.service-scheduling-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px 16px 32px;
}

.service-scheduling-modal .modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 400;
    color: #ffffff;
}

.service-scheduling-modal .close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.service-scheduling-modal .close-btn:hover {
    color: #ffffff;
}

.service-scheduling-modal .modal-content {
    padding: 0 32px 24px 32px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-content: start;
    gap: 12px;
}

.service-scheduling-modal .post-selection-group {
    grid-column: span 2;
}

/* Appointy Input Group Styles */
.service-scheduling-modal .appointy-input-group {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    min-height: 40px;
    transition: background 0.2s;
    position: relative;
}

.service-scheduling-modal .appointy-input-group:hover,
.service-scheduling-modal .appointy-input-group:focus-within {
    background: rgba(0, 0, 0, 0.5);
}

.service-scheduling-modal .appointy-input-icon {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    width: 24px;
    display: flex;
    justify-content: center;
}

.service-scheduling-modal .appointy-input {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 14px;
    flex: 1;
    padding: 12px;
    outline: none;
    width: 100%;
}

.service-scheduling-modal .appointy-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.service-scheduling-modal select.appointy-input {
    appearance: none;
    cursor: pointer;
}

.service-scheduling-modal select.appointy-input option {
    background-color: #23253b;
    color: #ffffff;
}

/* Custom dropdown arrow for selects */
.service-scheduling-modal .appointy-input-group select + .dropdown-arrow {
    position: absolute;
    right: 16px;
    pointer-events: none;
    color: rgba(255, 255, 255, 0.6);
}

/* Fixed Bottom Bar */
.service-scheduling-modal .appointy-bottom-bar {
    background: #1e1e1e;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    z-index: 10;
    flex-shrink: 0;
}

.service-scheduling-modal .order-total-toggle {
    display: flex;
    align-items: center;
    padding: 0 24px;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    flex: 1;
    transition: color 0.2s, background 0.2s;
}

.service-scheduling-modal .order-total-toggle:hover {
    color: #fff;
    background: #252525;
}

.service-scheduling-modal .order-total-toggle span {
    margin-right: 8px;
}

.service-scheduling-modal .book-btn {
    background: #e67e22; /* Appointy Orange/Gold */
    color: #fff;
    border: none;
    padding: 0 32px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
}

.service-scheduling-modal .book-btn:hover {
    background: #d35400;
}

/* Slide-up Order Summary Panel */
.service-scheduling-modal .appointy-slide-up-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 60px); /* Fill space above bottom bar */
    background: #222222;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

.service-scheduling-modal .appointy-slide-up-panel.open {
    transform: translateY(0);
}

.slide-up-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #333;
}

.slide-up-header h3 {
    color: #fff;
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.slide-up-close {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
}

.slide-up-close:hover {
    color: #fff;
}

.slide-up-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.summary-item {
    margin-bottom: 24px;
}

.summary-item-title {
    color: #fff;
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.summary-item-subtitle {
    color: #888;
    font-size: 12px;
}

/* Slide-up Form Controls */
.slide-up-form-group {
    margin-bottom: 16px;
}

.slide-up-form-group label {
    display: block;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.slide-up-input {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    padding: 10px;
    width: 100%;
    border-radius: 4px;
    outline: none;
    box-sizing: border-box;
}

.slide-up-input:focus {
    border-color: #0096ab;
}

.drip-feed-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.subtotal-row, .total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.subtotal-row {
    border-top: 1px solid #333;
    color: #888;
    font-size: 14px;
    text-transform: uppercase;
}

.total-row {
    border-top: 1px solid #333;
    color: #fff;
    font-size: 18px;
    text-transform: uppercase;
    padding-bottom: 80px; /* Space for the bottom bar below */
}

/* Radio Group styling if needed inside panel */
.service-scheduling-modal .radio-group {
    display: flex;
    gap: 16px;
}

.service-scheduling-modal .radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    text-transform: none;
}

.service-scheduling-modal input[type="radio"],
.service-scheduling-modal input[type="checkbox"] {
    accent-color: #0096ab;
}

.service-scheduling-modal .hidden {
    display: none !important;
}

/* Post Links Tab Styles */
.post-links-list {
    margin-top: 10px;
}

.post-link-card {
    background: #2a2c3a;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.post-link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-link-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.post-link-url {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.post-link-meta {
    color: #8a8b9f;
    font-size: 12px;
}

.post-link-details-btn {
    background: rgba(108, 93, 211, 0.2);
    color: #6C5DD3;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 16px;
    flex-shrink: 0;
}

.post-link-details-btn:hover {
    background: rgba(108, 93, 211, 0.4);
}

.post-link-details-content {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-link-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-run-item {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
    gap: 16px;
}

.run-time-col {
    width: 90px;
    flex-shrink: 0;
}

.run-date {
    color: #8a8b9f;
    font-size: 11px;
    margin-bottom: 2px;
}

.run-time {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.run-info-col {
    flex: 1;
    min-width: 0;
}

.run-service {
    color: #fff;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.run-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.run-meta {
    color: #8a8b9f;
    font-size: 11px;
}

.run-status-col {
    flex-shrink: 0;
}

.status-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.scheduled {
    background: rgba(108, 93, 211, 0.2);
    color: #6C5DD3;
}
.status-badge.processing {
    background: rgba(0, 150, 171, 0.2);
    color: #0096ab;
}
.status-badge.completed {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}
.status-badge.failed {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}
