/* Hyper WP Appointment - Frontend Booking Widget */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --hyper-apt-primary: #6366f1;
    --hyper-apt-primary-hover: #4f46e5;
    --hyper-apt-primary-light: rgba(99, 102, 241, 0.1);
    --hyper-apt-success: #22c55e;
    --hyper-apt-success-light: rgba(34, 197, 94, 0.1);
    --hyper-apt-warning: #f59e0b;
    --hyper-apt-danger: #ef4444;
    --hyper-apt-gray-50: #f9fafb;
    --hyper-apt-gray-100: #f3f4f6;
    --hyper-apt-gray-200: #e5e7eb;
    --hyper-apt-gray-300: #d1d5db;
    --hyper-apt-gray-400: #9ca3af;
    --hyper-apt-gray-500: #6b7280;
    --hyper-apt-gray-600: #4b5563;
    --hyper-apt-gray-700: #374151;
    --hyper-apt-gray-800: #1f2937;
    --hyper-apt-gray-900: #111827;
    --hyper-apt-radius: 12px;
    --hyper-apt-radius-sm: 8px;
    --hyper-apt-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --hyper-apt-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Main Container */
.hyper-apt-widget {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 680px;
    margin: 0 auto;
    padding: 0;
    color: var(--hyper-apt-gray-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.hyper-apt-widget * {
    box-sizing: border-box;
}

/* Card */
.hyper-apt-card {
    background: #ffffff;
    border-radius: var(--hyper-apt-radius);
    box-shadow: var(--hyper-apt-shadow-lg);
    overflow: hidden;
    border: 1px solid var(--hyper-apt-gray-200);
}

.hyper-apt-card-header {
    background: linear-gradient(135deg, var(--hyper-apt-primary), #818cf8);
    padding: 28px 32px;
    text-align: center;
}

.hyper-apt-card-header h2 {
    color: #ffffff;
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hyper-apt-card-header p {
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-size: 14px;
}

.hyper-apt-card-body {
    padding: 32px;
}

/* Progress Steps */
.hyper-apt-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 32px 0;
    gap: 0;
}

.hyper-apt-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hyper-apt-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    background: var(--hyper-apt-gray-200);
    color: var(--hyper-apt-gray-500);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.hyper-apt-step.active .hyper-apt-step-number {
    background: var(--hyper-apt-primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px var(--hyper-apt-primary-light);
}

.hyper-apt-step.completed .hyper-apt-step-number {
    background: var(--hyper-apt-success);
    color: #ffffff;
}

.hyper-apt-step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--hyper-apt-gray-400);
    display: none;
}

.hyper-apt-step.active .hyper-apt-step-label {
    color: var(--hyper-apt-primary);
}

.hyper-apt-step.completed .hyper-apt-step-label {
    color: var(--hyper-apt-success);
}

.hyper-apt-step-line {
    width: 40px;
    height: 2px;
    background: var(--hyper-apt-gray-200);
    margin: 0 4px;
    transition: background 0.3s ease;
}

.hyper-apt-step-line.completed {
    background: var(--hyper-apt-success);
}

@media (min-width: 600px) {
    .hyper-apt-step-label {
        display: block;
    }
    .hyper-apt-step-line {
        width: 50px;
    }
}

/* Step Content */
.hyper-apt-step-content {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.hyper-apt-step-content.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Title */
.hyper-apt-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--hyper-apt-gray-900);
    margin: 0 0 20px;
}

/* Services Grid */
.hyper-apt-services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 480px) {
    .hyper-apt-services-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.hyper-apt-service-item {
    border: 2px solid var(--hyper-apt-gray-200);
    border-radius: var(--hyper-apt-radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.hyper-apt-service-item:hover {
    border-color: var(--hyper-apt-primary);
    box-shadow: 0 0 0 3px var(--hyper-apt-primary-light);
}

.hyper-apt-service-item.selected {
    border-color: var(--hyper-apt-primary);
    background: var(--hyper-apt-primary-light);
}

.hyper-apt-service-item.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: var(--hyper-apt-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.hyper-apt-service-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--hyper-apt-gray-900);
    margin-bottom: 4px;
}

.hyper-apt-service-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--hyper-apt-gray-500);
}

.hyper-apt-service-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hyper-apt-service-desc {
    font-size: 13px;
    color: var(--hyper-apt-gray-500);
    margin-top: 6px;
}

/* Staff Grid */
.hyper-apt-staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.hyper-apt-staff-item {
    border: 2px solid var(--hyper-apt-gray-200);
    border-radius: var(--hyper-apt-radius-sm);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hyper-apt-staff-item:hover {
    border-color: var(--hyper-apt-primary);
}

.hyper-apt-staff-item.selected {
    border-color: var(--hyper-apt-primary);
    background: var(--hyper-apt-primary-light);
}

.hyper-apt-staff-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.hyper-apt-staff-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--hyper-apt-gray-800);
}

/* Calendar */
.hyper-apt-calendar {
    user-select: none;
}

.hyper-apt-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.hyper-apt-calendar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--hyper-apt-gray-900);
}

.hyper-apt-calendar-nav {
    display: flex;
    gap: 4px;
}

.hyper-apt-calendar-nav button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--hyper-apt-gray-200);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--hyper-apt-gray-600);
    transition: all 0.2s ease;
}

.hyper-apt-calendar-nav button:hover {
    background: var(--hyper-apt-gray-100);
    border-color: var(--hyper-apt-gray-300);
}

.hyper-apt-calendar-nav button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.hyper-apt-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 8px;
}

.hyper-apt-calendar-weekdays span {
    font-size: 12px;
    font-weight: 600;
    color: var(--hyper-apt-gray-400);
    text-transform: uppercase;
    padding: 8px 0;
}

.hyper-apt-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.hyper-apt-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    color: var(--hyper-apt-gray-700);
    min-height: 40px;
}

.hyper-apt-calendar-day:hover:not(.disabled):not(.empty) {
    background: var(--hyper-apt-primary-light);
}

.hyper-apt-calendar-day.empty {
    cursor: default;
}

.hyper-apt-calendar-day.disabled {
    color: var(--hyper-apt-gray-300);
    cursor: not-allowed;
}

.hyper-apt-calendar-day.available::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--hyper-apt-success);
}

.hyper-apt-calendar-day.selected {
    background: var(--hyper-apt-primary);
    color: #ffffff;
    font-weight: 600;
}

.hyper-apt-calendar-day.selected::after {
    background: rgba(255, 255, 255, 0.8);
}

.hyper-apt-calendar-day.today {
    border: 2px solid var(--hyper-apt-primary);
}

/* Time Slots */
.hyper-apt-time-section {
    margin-bottom: 20px;
}

.hyper-apt-time-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--hyper-apt-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hyper-apt-time-section-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.hyper-apt-time-section.morning .hyper-apt-time-section-title::before {
    background: #fbbf24;
}

.hyper-apt-time-section.afternoon .hyper-apt-time-section-title::before {
    background: #f97316;
}

.hyper-apt-time-section.evening .hyper-apt-time-section-title::before {
    background: #8b5cf6;
}

.hyper-apt-time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hyper-apt-time-slot {
    padding: 10px 18px;
    border-radius: 24px;
    border: 2px solid var(--hyper-apt-gray-200);
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: var(--hyper-apt-gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    text-align: center;
}

.hyper-apt-time-slot:hover {
    border-color: var(--hyper-apt-primary);
    color: var(--hyper-apt-primary);
    transform: translateY(-1px);
}

.hyper-apt-time-slot.selected {
    background: var(--hyper-apt-primary);
    border-color: var(--hyper-apt-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.hyper-apt-no-slots {
    text-align: center;
    padding: 32px;
    color: var(--hyper-apt-gray-500);
    font-size: 14px;
}

.hyper-apt-no-slots svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* Form Styles */
.hyper-apt-form-group {
    margin-bottom: 20px;
    position: relative;
}

.hyper-apt-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--hyper-apt-gray-700);
    margin-bottom: 6px;
}

.hyper-apt-form-group label .required {
    color: var(--hyper-apt-danger);
}

.hyper-apt-form-group input,
.hyper-apt-form-group textarea,
.hyper-apt-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--hyper-apt-gray-200);
    border-radius: var(--hyper-apt-radius-sm);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--hyper-apt-gray-800);
    background: #fff;
    transition: all 0.2s ease;
    outline: none;
}

.hyper-apt-form-group input:focus,
.hyper-apt-form-group textarea:focus,
.hyper-apt-form-group select:focus {
    border-color: var(--hyper-apt-primary);
    box-shadow: 0 0 0 3px var(--hyper-apt-primary-light);
}

.hyper-apt-form-group input.error,
.hyper-apt-form-group textarea.error {
    border-color: var(--hyper-apt-danger);
}

.hyper-apt-form-group .error-message {
    font-size: 12px;
    color: var(--hyper-apt-danger);
    margin-top: 4px;
    display: none;
}

.hyper-apt-form-group input.error + .error-message,
.hyper-apt-form-group textarea.error + .error-message {
    display: block;
}

.hyper-apt-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 479px) {
    .hyper-apt-form-row {
        grid-template-columns: 1fr;
    }
}

/* Summary Card */
.hyper-apt-summary {
    background: var(--hyper-apt-gray-50);
    border-radius: var(--hyper-apt-radius-sm);
    padding: 24px;
    border: 1px solid var(--hyper-apt-gray-200);
}

.hyper-apt-summary h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--hyper-apt-gray-900);
}

.hyper-apt-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--hyper-apt-gray-200);
    font-size: 14px;
}

.hyper-apt-summary-row:last-child {
    border-bottom: none;
}

.hyper-apt-summary-label {
    color: var(--hyper-apt-gray-500);
}

.hyper-apt-summary-value {
    font-weight: 600;
    color: var(--hyper-apt-gray-900);
}

.hyper-apt-summary-total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--hyper-apt-gray-200);
    display: flex;
    justify-content: space-between;
    font-size: 16px;
}

.hyper-apt-summary-total .hyper-apt-summary-value {
    color: var(--hyper-apt-primary);
    font-size: 18px;
}

/* Buttons */
.hyper-apt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--hyper-apt-radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-height: 48px;
}

.hyper-apt-btn-primary {
    background: var(--hyper-apt-primary);
    color: #ffffff;
}

.hyper-apt-btn-primary:hover {
    background: var(--hyper-apt-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.hyper-apt-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hyper-apt-btn-outline {
    background: #fff;
    color: var(--hyper-apt-gray-700);
    border: 2px solid var(--hyper-apt-gray-200);
}

.hyper-apt-btn-outline:hover {
    border-color: var(--hyper-apt-gray-300);
    background: var(--hyper-apt-gray-50);
}

.hyper-apt-btn-full {
    width: 100%;
}

.hyper-apt-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.hyper-apt-actions .hyper-apt-btn {
    flex: 1;
}

/* Loading */
.hyper-apt-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    flex-direction: column;
    gap: 12px;
}

.hyper-apt-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--hyper-apt-gray-200);
    border-top-color: var(--hyper-apt-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hyper-apt-loading-text {
    font-size: 14px;
    color: var(--hyper-apt-gray-500);
}

/* Skeleton Loading */
.hyper-apt-skeleton {
    background: linear-gradient(90deg, var(--hyper-apt-gray-100) 25%, var(--hyper-apt-gray-200) 50%, var(--hyper-apt-gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Success State */
.hyper-apt-success-state {
    text-align: center;
    padding: 40px 20px;
    animation: fadeInUp 0.5s ease;
}

.hyper-apt-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--hyper-apt-success-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: scaleIn 0.4s ease 0.2s both;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.hyper-apt-success-icon svg {
    width: 40px;
    height: 40px;
    color: var(--hyper-apt-success);
}

.hyper-apt-success-icon .checkmark {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.6s ease 0.5s forwards;
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.hyper-apt-success-state h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--hyper-apt-gray-900);
    margin: 0 0 8px;
}

.hyper-apt-success-state p {
    font-size: 15px;
    color: var(--hyper-apt-gray-500);
    margin: 0 0 24px;
}

/* Error State */
.hyper-apt-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--hyper-apt-radius-sm);
    padding: 12px 16px;
    color: #dc2626;
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive */
@media (max-width: 600px) {
    .hyper-apt-card-body {
        padding: 20px;
    }

    .hyper-apt-card-header {
        padding: 20px;
    }

    .hyper-apt-card-header h2 {
        font-size: 18px;
    }

    .hyper-apt-time-slot {
        min-width: 80px;
        padding: 8px 14px;
        font-size: 13px;
    }

    .hyper-apt-calendar-day {
        min-height: 36px;
        font-size: 13px;
    }

    .hyper-apt-btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px;
    }

    .hyper-apt-actions {
        flex-direction: column;
    }
}
