/**
 * PrevCal Public Styles - Modern Design
 *
 * @package PrevCal
 */

:root {
    --prevcal-primary: #6366f1;
    --prevcal-primary-dark: #4f46e5;
    --prevcal-secondary: #8b5cf6;
    --prevcal-background: #ffffff;
    --prevcal-surface: #f8fafc;
    --prevcal-text: #1e293b;
    --prevcal-text-muted: #64748b;
    --prevcal-border: #e2e8f0;
    --prevcal-success: #10b981;
    --prevcal-error: #ef4444;
    --prevcal-warning: #f59e0b;
    --prevcal-radius: 16px;
    --prevcal-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.prevcal-booking-widget {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    background: var(--prevcal-background);
    color: var(--prevcal-text);
    border-radius: var(--prevcal-radius);
    box-shadow: var(--prevcal-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.prevcal-booking-widget * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.prevcal-header {
    background: linear-gradient(135deg, var(--prevcal-primary) 0%, var(--prevcal-secondary) 100%);
    color: white;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.prevcal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -20px); }
}

.prevcal-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.prevcal-header p {
    font-size: 16px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.prevcal-body {
    padding: 32px 24px;
    background: var(--prevcal-background);
}

.prevcal-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.prevcal-step.active {
    display: block;
}

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

.prevcal-step-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--prevcal-text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.prevcal-step-title::before {
    content: '';
    width: 4px;
    height: 28px;
    background: linear-gradient(180deg, var(--prevcal-primary) 0%, var(--prevcal-secondary) 100%);
    border-radius: 2px;
}

.prevcal-step-layout {
    display: grid;
    grid-template-columns: minmax(220px, 300px) 1fr;
    gap: 24px;
    align-items: start;
}

.prevcal-step-sidebar {
    background: linear-gradient(180deg, var(--prevcal-surface) 0%, #ffffff 100%);
    border: 1px solid var(--prevcal-border);
    border-radius: 12px;
    padding: 16px;
    position: sticky;
    top: 16px;
}

.prevcal-sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--prevcal-text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.prevcal-selected-service-inner h5 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

.prevcal-selected-service-inner p {
    color: var(--prevcal-text-muted);
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.45;
}

.prevcal-selected-service-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.prevcal-selected-service-meta strong {
    color: var(--prevcal-primary);
    font-size: 16px;
}

.prevcal-service-list {
    display: grid;
    gap: 16px;
}

.prevcal-service-item {
    background: var(--prevcal-surface);
    border: 2px solid var(--prevcal-border);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.prevcal-service-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--prevcal-primary) 0%, var(--prevcal-secondary) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.prevcal-service-item:hover {
    border-color: var(--prevcal-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.prevcal-service-item:hover::before {
    opacity: 1;
}

.prevcal-service-item.selected {
    border-color: var(--prevcal-primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.prevcal-service-item.selected::before {
    opacity: 1;
}

.prevcal-service-name {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--prevcal-text);
}

.prevcal-service-description {
    font-size: 14px;
    color: var(--prevcal-text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.prevcal-service-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: var(--prevcal-text-muted);
}

.prevcal-service-price {
    font-weight: 700;
    font-size: 20px;
    color: var(--prevcal-primary);
}

/* Modern Calendar */
.prevcal-calendar {
    margin-bottom: 24px;
}

.prevcal-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--prevcal-surface);
    border-radius: 12px;
}

.prevcal-calendar-nav {
    background: white;
    border: 2px solid var(--prevcal-border);
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 10px;
    transition: all 0.3s;
    color: var(--prevcal-text);
    font-size: 18px;
    font-weight: 600;
}

.prevcal-calendar-nav:hover {
    border-color: var(--prevcal-primary);
    color: var(--prevcal-primary);
    transform: scale(1.05);
}

.prevcal-calendar-title {
    font-weight: 700;
    font-size: 20px;
    color: var(--prevcal-text);
}

.prevcal-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.prevcal-calendar-day-header {
    text-align: center;
    font-weight: 700;
    font-size: 12px;
    color: var(--prevcal-text-muted);
    padding: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prevcal-calendar-day {
    text-align: center;
    padding: 16px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 600;
    color: var(--prevcal-text);
    background: var(--prevcal-surface);
    border: 2px solid transparent;
}

.prevcal-calendar-day:hover:not(.disabled) {
    background: var(--prevcal-primary);
    color: white;
    transform: scale(1.1);
}

.prevcal-calendar-day.selected {
    background: linear-gradient(135deg, var(--prevcal-primary) 0%, var(--prevcal-secondary) 100%);
    color: white;
    border-color: var(--prevcal-primary-dark);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.prevcal-calendar-day.disabled {
    color: var(--prevcal-text-muted);
    cursor: not-allowed;
    opacity: 0.5;
    background: var(--prevcal-surface);
}

.prevcal-calendar-day.today {
    font-weight: 700;
    border-color: var(--prevcal-primary);
    color: var(--prevcal-primary);
}

.prevcal-calendar-day.today.selected {
    color: white;
}

/* Time Slots */
.prevcal-time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.prevcal-time-slot {
    padding: 16px;
    border: 2px solid var(--prevcal-border);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 600;
    color: var(--prevcal-text);
    background: white;
}

.prevcal-time-slot:hover:not(.disabled) {
    border-color: var(--prevcal-primary);
    color: var(--prevcal-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.prevcal-time-slot.selected {
    border-color: var(--prevcal-primary);
    background: linear-gradient(135deg, var(--prevcal-primary) 0%, var(--prevcal-secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.prevcal-time-slot.disabled {
    color: var(--prevcal-text-muted);
    cursor: not-allowed;
    opacity: 0.5;
    background: var(--prevcal-surface);
}

/* Form Styling */
.prevcal-form-group {
    margin-bottom: 24px;
}

.prevcal-form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--prevcal-text);
}

.prevcal-form-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--prevcal-border);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
    color: var(--prevcal-text);
}

.prevcal-form-input:focus {
    outline: none;
    border-color: var(--prevcal-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.prevcal-form-textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--prevcal-border);
    border-radius: 12px;
    font-size: 15px;
    min-height: 120px;
    resize: vertical;
    transition: all 0.3s;
    background: white;
    color: var(--prevcal-text);
}

.prevcal-form-textarea:focus {
    outline: none;
    border-color: var(--prevcal-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.prevcal-form-error {
    color: var(--prevcal-error);
    font-size: 13px;
    margin-top: 8px;
    font-weight: 500;
}

/* Summary */
.prevcal-summary {
    background: linear-gradient(135deg, var(--prevcal-surface) 0%, white 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 2px solid var(--prevcal-border);
}

.prevcal-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--prevcal-border);
}

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

.prevcal-summary-label {
    font-weight: 600;
    color: var(--prevcal-text-muted);
}

.prevcal-summary-value {
    color: var(--prevcal-text);
    font-weight: 600;
}

.prevcal-summary-total {
    font-size: 24px;
    font-weight: 700;
    color: var(--prevcal-primary);
}

/* Buttons */
.prevcal-button {
    width: 100%;
    padding: 18px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prevcal-button-primary {
    background: linear-gradient(135deg, var(--prevcal-primary) 0%, var(--prevcal-secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.prevcal-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.5);
}

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

.prevcal-button-secondary {
    background: var(--prevcal-surface);
    color: var(--prevcal-text);
    border: 2px solid var(--prevcal-border);
}

.prevcal-button-secondary:hover {
    background: var(--prevcal-border);
    transform: translateY(-2px);
}

.prevcal-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading */
.prevcal-loading {
    text-align: center;
    padding: 60px 24px;
}

.prevcal-spinner {
    border: 4px solid var(--prevcal-surface);
    border-top: 4px solid var(--prevcal-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success */
.prevcal-success {
    text-align: center;
    padding: 60px 32px;
}

.prevcal-success-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--prevcal-success) 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.prevcal-success-icon svg {
    width: 50px;
    height: 50px;
    fill: white;
}

.prevcal-success-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--prevcal-text);
    margin-bottom: 12px;
}

.prevcal-success-message {
    color: var(--prevcal-text-muted);
    margin-bottom: 32px;
    font-size: 16px;
    line-height: 1.6;
}

/* Error */
.prevcal-error {
    background: linear-gradient(135deg, #fef2f2 0%, white 100%);
    border: 2px solid #fecaca;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    color: #dc2626;
    font-weight: 500;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Navigation */
.prevcal-navigation {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.prevcal-back-button {
    flex: 1;
}

.prevcal-next-button {
    flex: 2;
}

/* Responsive */
@media (max-width: 640px) {
    .prevcal-booking-widget {
        border-radius: 0;
        box-shadow: none;
    }
    
    .prevcal-header {
        padding: 24px 16px;
    }
    
    .prevcal-header h2 {
        font-size: 24px;
    }
    
    .prevcal-body {
        padding: 24px 16px;
    }

    .prevcal-step-layout {
        grid-template-columns: 1fr;
    }

    .prevcal-step-sidebar {
        position: static;
    }
    
    .prevcal-time-slots {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
    
    .prevcal-calendar-day {
        padding: 12px 6px;
        font-size: 14px;
    }
    
    .prevcal-button {
        padding: 16px 24px;
        font-size: 15px;
    }
}

