/* ==========================================================================
   WP Reservation System — Stylesheet
   ========================================================================== */

:root {
    --wprs-primary: #185FA5;
    --wprs-primary-light: #E6F1FB;
    --wprs-primary-hover: #0C447C;
    --wprs-success: #0F6E56;
    --wprs-success-light: #E1F5EE;
    --wprs-danger: #A32D2D;
    --wprs-danger-light: #FCEBEB;
    --wprs-warning: #854F0B;
    --wprs-warning-light: #FAEEDA;
    --wprs-text: #2C2C2A;
    --wprs-text-secondary: #5F5E5A;
    --wprs-text-tertiary: #888780;
    --wprs-border: rgba(0, 0, 0, 0.12);
    --wprs-bg: #ffffff;
    --wprs-bg-secondary: #F5F4F0;
    --wprs-radius: 8px;
    --wprs-radius-lg: 12px;
    --wprs-font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

/* ── Container ── */
.wprs-container {
    font-family: var(--wprs-font);
    color: var(--wprs-text);
    max-width: 520px;
    margin: 0 auto;
    padding: 0 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.wprs-container *, .wprs-container *::before, .wprs-container *::after {
    box-sizing: border-box;
}

/* ── Loading ── */
.wprs-loading {
    text-align: center;
    padding: 48px 16px;
    color: var(--wprs-text-tertiary);
    font-size: 14px;
}

/* ── Intro section (above card) ── */
.wprs-intro-section {
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--wprs-text);
}

.wprs-intro-text {
    margin: 0 0 12px;
}

.wprs-intro-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--wprs-primary-light);
    border-left: 3px solid var(--wprs-primary);
    border-radius: 0 var(--wprs-radius) var(--wprs-radius) 0;
    padding: 12px 14px;
    margin-top: 16px;
}

.wprs-intro-notice-icon {
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1.8;
}

.wprs-intro-notice p {
    margin: 0;
    font-size: 13px;
    line-height: 1.8;
    color: var(--wprs-text);
}

/* ── Card ── */
.wprs-card {
    background: var(--wprs-bg);
    border: 1px solid var(--wprs-border);
    border-radius: var(--wprs-radius-lg);
    overflow: hidden;
}

/* ── Service banner (above card) ── */
.wprs-service-banner {
    text-align: center;
    padding: 16px 0 14px;
}

.wprs-service-banner-link {
    font-size: 20px;
    font-weight: 600;
    color: var(--wprs-text);
    text-decoration: none;
    transition: opacity 0.15s;
}

.wprs-service-banner-link:hover {
    opacity: 0.7;
    text-decoration: none;
}

/* ── Service info (inside card) ── */
.wprs-service-info {
    padding: 10px 20px 0;
    text-align: center;
}

.wprs-service-note {
    font-size: 13px;
    color: var(--wprs-text-secondary);
    margin: 0 0 4px;
}

.wprs-service-prompt {
    font-size: 13px;
    color: var(--wprs-text-secondary);
    margin: 0;
}

/* ── Header bar ── */
.wprs-header {
    display: grid;
    grid-template-columns: 70px 1fr 70px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--wprs-border);
}

.wprs-header-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 auto;
    text-align: center;
    width: fit-content;
}

.wprs-header > *:last-child {
    text-align: right;
}

.wprs-nav-btn {
    background: none;
    border: 1px solid var(--wprs-border);
    border-radius: var(--wprs-radius);
    padding: 6px 12px;
    font-size: 13px;
    color: var(--wprs-text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.wprs-nav-btn:hover {
    background: var(--wprs-bg-secondary);
    color: var(--wprs-text);
}

.wprs-back-link {
    font-size: 13px;
    color: var(--wprs-primary);
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    text-decoration: none;
    white-space: nowrap;
}

.wprs-back-link:hover {
    text-decoration: underline;
}

/* ── Calendar grid ── */
.wprs-calendar-body {
    padding: 12px 16px 16px;
}

.wprs-weekday-row, .wprs-day-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.wprs-weekday-row {
    margin-bottom: 6px;
}

.wprs-weekday {
    font-size: 12px;
    font-weight: 600;
    color: var(--wprs-text-tertiary);
    padding: 4px 0;
}

.wprs-weekday.wprs-sun {
    color: var(--wprs-danger);
}

.wprs-weekday.wprs-sat {
    color: var(--wprs-primary);
}

.wprs-day {
    font-size: 13px;
    padding: 8px 0;
    border-radius: 6px;
    color: var(--wprs-text-tertiary);
    position: relative;
}

.wprs-day.wprs-empty {
    visibility: hidden;
}

.wprs-day.wprs-unavailable {
    color: var(--wprs-text-tertiary);
    opacity: 0.4;
    text-decoration: line-through;
}

.wprs-day.wprs-available {
    background: var(--wprs-primary-light);
    color: var(--wprs-primary);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.wprs-day.wprs-available:hover {
    background: var(--wprs-primary);
    color: #fff;
    transform: scale(1.05);
}

.wprs-day.wprs-today {
    outline: 2px solid var(--wprs-primary);
    outline-offset: -2px;
}

/* ── Legend ── */
.wprs-legend {
    display: flex;
    gap: 16px;
    padding: 8px 16px 12px;
    font-size: 12px;
    color: var(--wprs-text-secondary);
}

.wprs-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wprs-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.wprs-legend-dot.available {
    background: var(--wprs-primary-light);
}

.wprs-legend-dot.unavailable {
    background: var(--wprs-bg-secondary);
}

/* ── Time slots ── */
.wprs-slots-body {
    padding: 16px 20px;
}

.wprs-date-display {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
}

.wprs-slots-info {
    font-size: 13px;
    color: var(--wprs-text-secondary);
    margin: 0 0 16px;
}

.wprs-slots-label {
    font-size: 13px;
    color: var(--wprs-text-secondary);
    margin: 0 0 10px;
}

.wprs-slot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wprs-slot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--wprs-border);
    border-radius: var(--wprs-radius);
    font-size: 14px;
    transition: border-color 0.15s, background 0.15s;
}

.wprs-slot.available {
    cursor: pointer;
}

.wprs-slot.available:hover {
    border-color: var(--wprs-primary);
    background: var(--wprs-primary-light);
}

.wprs-slot.unavailable {
    opacity: 0.4;
}

.wprs-slot-time {
    font-weight: 500;
}

.wprs-badge {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 500;
}

.wprs-badge.available {
    background: var(--wprs-success-light);
    color: var(--wprs-success);
}

.wprs-badge.booked {
    background: var(--wprs-danger-light);
    color: var(--wprs-danger);
}

.wprs-badge.past {
    background: var(--wprs-bg-secondary);
    color: var(--wprs-text-tertiary);
}

/* ── Form ── */
.wprs-form-body {
    padding: 16px 20px;
}

.wprs-selected-slot {
    background: var(--wprs-bg-secondary);
    border-radius: var(--wprs-radius);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.wprs-selected-slot-label {
    font-size: 13px;
    color: var(--wprs-text-secondary);
    margin: 0;
}

.wprs-selected-slot-value {
    font-size: 15px;
    font-weight: 600;
    margin: 4px 0 0;
}

.wprs-form-group {
    margin-bottom: 14px;
}

.wprs-form-label {
    display: block;
    font-size: 13px;
    color: var(--wprs-text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.wprs-form-label .required {
    color: var(--wprs-danger);
    margin-left: 2px;
}

.wprs-input, .wprs-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--wprs-border);
    border-radius: var(--wprs-radius);
    font-size: 14px;
    font-family: var(--wprs-font);
    color: var(--wprs-text);
    background: var(--wprs-bg);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.wprs-input:focus, .wprs-textarea:focus {
    border-color: var(--wprs-primary);
    box-shadow: 0 0 0 3px rgba(24, 95, 165, 0.1);
}

.wprs-input::placeholder, .wprs-textarea::placeholder {
    color: var(--wprs-text-tertiary);
}

.wprs-textarea {
    resize: vertical;
    min-height: 80px;
}

.wprs-input.error, .wprs-textarea.error {
    border-color: var(--wprs-danger);
}

.wprs-error-text {
    color: var(--wprs-danger);
    font-size: 12px;
    margin-top: 4px;
}

.wprs-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--wprs-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
    font-family: var(--wprs-font);
}

.wprs-btn:active {
    transform: scale(0.98);
}

.wprs-btn-primary {
    background: var(--wprs-primary);
    color: #fff;
}

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

.wprs-btn-primary:disabled {
    background: var(--wprs-text-tertiary);
    cursor: not-allowed;
}

.wprs-btn-secondary {
    background: var(--wprs-bg);
    color: var(--wprs-text);
    border: 1px solid var(--wprs-border);
}

.wprs-btn-secondary:hover {
    background: var(--wprs-bg-secondary);
}

/* ── Form note ── */
.wprs-form-note {
    background: var(--wprs-bg-secondary);
    border-radius: var(--wprs-radius);
    padding: 12px 14px;
    margin: 14px 0 16px;
}

.wprs-form-note p {
    font-size: 13px;
    color: var(--wprs-text-secondary);
    margin: 0;
    line-height: 1.7;
}

/* ── Sunday styling ── */
.wprs-day.wprs-sunday {
    color: var(--wprs-text-tertiary);
    opacity: 0.4;
}

.wprs-day.wprs-past {
    color: var(--wprs-text-tertiary);
    opacity: 0.3;
    text-decoration: line-through;
}

/* ── Confirmation ── */
.wprs-confirm-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.wprs-confirm-table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--wprs-border);
    vertical-align: top;
}

.wprs-confirm-table tr:last-child td {
    border-bottom: none;
}

.wprs-confirm-table td:first-child {
    color: var(--wprs-text-secondary);
    font-weight: 500;
    width: 100px;
    padding-right: 12px;
}

.wprs-btn-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.wprs-btn-group .wprs-btn {
    flex: 1;
}

/* ── Complete ── */
.wprs-complete {
    text-align: center;
    padding: 32px 20px;
}

.wprs-complete-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--wprs-success-light);
    color: var(--wprs-success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
}

.wprs-complete-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
}

.wprs-complete-desc {
    font-size: 14px;
    color: var(--wprs-text-secondary);
    margin: 0;
}

/* ── Error / info messages ── */
.wprs-message {
    padding: 12px 16px;
    border-radius: var(--wprs-radius);
    font-size: 13px;
    margin-bottom: 16px;
}

.wprs-message.error {
    background: var(--wprs-danger-light);
    color: var(--wprs-danger);
}

.wprs-message.info {
    background: var(--wprs-primary-light);
    color: var(--wprs-primary);
}

/* ── Standalone page ── */
.wprs-standalone-page {
    background: var(--wprs-bg-secondary);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: var(--wprs-font);
}

.wprs-standalone-wrapper {
    max-width: 560px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.wprs-standalone-header {
    text-align: center;
    padding: 16px 0 24px;
}

.wprs-standalone-header a {
    font-size: 18px;
    font-weight: 600;
    color: var(--wprs-text);
    text-decoration: none;
}

/* ── Spinner ── */
.wprs-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wprs-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes wprs-spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .wprs-container {
        max-width: 100%;
        padding: 0 8px;
    }
    .wprs-header {
        padding: 12px 14px;
    }
    .wprs-calendar-body, .wprs-slots-body, .wprs-form-body {
        padding: 12px 14px;
    }
}

/* ── Force center in WordPress themes ── */
#wprs-app {
    max-width: 520px;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 16px;
    float: none !important;
}

/* WordPress content area full-width override */
.entry-content,
.post-content,
.page-content,
.content-area,
.site-content,
.l-content,
.c-content,
article .entry-content {
    max-width: 100% !important;
    width: 100% !important;
    float: none !important;
}

/* Lightning / VK theme specific overrides */
.site-body .container,
.site-body .container-fluid,
.site-body .row,
.vk_posts,
.main-section {
    max-width: 100% !important;
    width: 100% !important;
    float: none !important;
    display: block !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.main-section {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Hide sidebar for full-width layout */
.sub-section,
.side-section,
.sidebar-section {
    display: none !important;
}

/* Override Lightning column layout */
.site-body .col-lg-8,
.site-body .col-md-8,
.site-body .col-lg-9,
.site-body .col-md-9 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}
