/**
 * Appointment Booking Plugin - Frontend Styles
 * Mobile-first, modern and engaging UI
 */

/* Reset and Base Styles */
.abp-booking-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.abp-booking-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    max-width: 100%;
    margin: 0 auto;
    padding: 16px;
}

.abp-booking-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 24px;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-in;
}

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

/* Header */
.abp-header {
    text-align: center;
    margin-bottom: 32px;
}

.abp-title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.abp-subtitle {
    font-size: 15px;
    color: #6b7280;
    font-weight: 400;
}

/* Step Indicator */
.abp-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 8px;
}

.abp-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.abp-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-bottom: 6px;
}

.abp-step.active .abp-step-number {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.abp-step.completed .abp-step-number {
    background: #10b981;
    color: white;
}

.abp-step-label {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    text-align: center;
}

.abp-step.active .abp-step-label {
    color: #3b82f6;
    font-weight: 600;
}

.abp-step-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin: 0 4px;
    align-self: flex-start;
    margin-top: 17px;
}

/* Form Steps */
.abp-form-step {
    display: none;
    animation: slideIn 0.3s ease-out;
}

.abp-form-step.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.abp-step-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 20px;
    text-align: center;
}

/* Examination Type Grid */
.abp-examination-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.abp-exam-card {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.abp-exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--exam-color, #3b82f6);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.abp-exam-card:hover {
    border-color: var(--exam-color, #3b82f6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.abp-exam-card:hover::before {
    transform: scaleX(1);
}

.abp-exam-card.selected {
    border-color: var(--exam-color, #3b82f6);
    background: linear-gradient(135deg, var(--exam-color-light, #eff6ff) 0%, #ffffff 100%);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.abp-exam-card.selected::before {
    transform: scaleX(1);
}

.abp-exam-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.abp-exam-icon {
    font-size: 32px;
    line-height: 1;
}

.abp-exam-name {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    flex: 1;
}

.abp-exam-duration {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

.abp-exam-duration::before {
    content: '⏱️';
}

/* Date Picker */
.abp-date-picker-wrapper {
    margin-bottom: 24px;
}

.abp-date-input {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.abp-date-input:hover {
    border-color: #3b82f6;
}

.abp-date-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Selected Info */
.abp-selected-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #3b82f6;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.abp-selected-info p {
    margin: 0;
    color: #1e40af;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Time Slots Grid */
.abp-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.abp-time-slot {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: #374151;
    transition: all 0.2s ease;
}

.abp-time-slot:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: scale(1.05);
}

.abp-time-slot.selected {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #2563eb;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.abp-time-slot.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f3f4f6;
}

.abp-time-slot.disabled:hover {
    border-color: #e5e7eb;
    background: #f3f4f6;
    transform: none;
}

/* Loading Spinner */
.abp-loading {
    text-align: center;
    padding: 40px 20px;
}

.abp-spinner {
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.abp-loading p {
    color: #6b7280;
    font-size: 14px;
}

/* Booking Summary */
.abp-booking-summary {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid #10b981;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.abp-summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #065f46;
    font-weight: 500;
}

.abp-summary-item:last-child {
    margin-bottom: 0;
}

.abp-summary-icon {
    font-size: 20px;
}

/* Form Groups */
.abp-form-group {
    margin-bottom: 20px;
}

.abp-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.abp-icon {
    font-size: 18px;
}

.abp-input,
.abp-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    transition: all 0.3s ease;
    font-family: inherit;
}

.abp-input:hover,
.abp-textarea:hover {
    border-color: #cbd5e1;
}

.abp-input:focus,
.abp-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.abp-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Navigation Buttons */
.abp-navigation {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.abp-btn {
    flex: 1;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.abp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.abp-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.abp-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.abp-btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.abp-btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #cbd5e1;
}

.abp-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.abp-btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Success Message */
.abp-success-container {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease-in;
}

.abp-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 24px;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.abp-success-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
}

.abp-success-text {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 24px;
    line-height: 1.6;
}

.abp-success-details {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.abp-success-details p {
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
}

.abp-success-details p:last-child {
    margin-bottom: 0;
}

/* Tablet Styles */
@media (min-width: 640px) {
    .abp-booking-wrapper {
        padding: 24px;
    }
    
    .abp-booking-card {
        padding: 32px;
    }
    
    .abp-title {
        font-size: 32px;
    }
    
    .abp-examination-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .abp-time-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
    
    .abp-step-label {
        font-size: 12px;
    }
}

/* Desktop Styles */
@media (min-width: 768px) {
    .abp-booking-wrapper {
        padding: 32px;
    }
    
    .abp-booking-card {
        padding: 40px;
    }
    
    .abp-examination-grid {
        gap: 20px;
    }
    
    .abp-time-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .abp-booking-card {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .abp-title,
    .abp-step-title,
    .abp-exam-name {
        color: #f9fafb;
    }
    
    .abp-subtitle {
        color: #9ca3af;
    }
    
    .abp-exam-card {
        background: #374151;
        border-color: #4b5563;
    }
    
    .abp-input,
    .abp-textarea,
    .abp-date-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .abp-time-slot {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
}

/* Accessibility */
.abp-btn:focus-visible,
.abp-input:focus-visible,
.abp-textarea:focus-visible,
.abp-exam-card:focus-visible,
.abp-time-slot:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .abp-navigation {
        display: none;
    }
}
