/**
 * SAAS Tab Booking Pro - Public Styles
 */

/* Variables */
:root {
    --stbp-primary: #4CAF50;
    --stbp-secondary: #2196F3;
    --stbp-success: #4CAF50;
    --stbp-danger: #F44336;
    --stbp-warning: #FFC107;
    --stbp-info: #2196F3;
    --stbp-light: #f5f5f5;
    --stbp-dark: #333;
    --stbp-border: #ddd;
    --stbp-radius: 8px;
    --stbp-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Booking Form Wrapper */
.stbp-booking-form-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.stbp-booking-form-container {
    background: white;
    border-radius: var(--stbp-radius);
    box-shadow: var(--stbp-shadow);
    padding: 30px;
    position: relative;
}

.stbp-form-title {
    text-align: center;
    margin: 0 0 30px;
    color: var(--stbp-dark);
    font-size: 28px;
}

/* Form Steps */
.stbp-form-step {
    display: none;
}

.stbp-form-step.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stbp-step-title {
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--stbp-light);
    color: var(--stbp-dark);
}

/* Services Grid */
.stbp-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stbp-service-card {
    border: 2px solid var(--stbp-border);
    border-radius: var(--stbp-radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stbp-service-card:hover {
    border-color: var(--stbp-primary);
    box-shadow: var(--stbp-shadow);
    transform: translateY(-2px);
}

.stbp-service-card.selected {
    border-color: var(--stbp-primary);
    background-color: rgba(76, 175, 80, 0.05);
}

.stbp-service-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-radius: var(--stbp-radius);
    margin-bottom: 15px;
}

.stbp-service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stbp-service-name {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--stbp-dark);
}

.stbp-service-description {
    margin: 0 0 15px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.stbp-service-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.stbp-service-duration {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 14px;
}

.stbp-service-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--stbp-primary);
}

.stbp-service-select-overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: var(--stbp-primary);
    border-radius: 0 var(--stbp-radius) 0 20px;
    display: none;
    align-items: center;
    justify-content: center;
}

.stbp-service-card.selected .stbp-service-select-overlay {
    display: flex;
}

.stbp-checkmark {
    color: white;
    font-size: 20px;
    font-weight: bold;
}

/* Date & Time Selection */
.stbp-datetime-selection {
    display: grid;
    gap: 20px;
}

.stbp-date-picker-wrapper label,
.stbp-staff-selection label,
.stbp-time-slots-wrapper label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--stbp-dark);
}

.stbp-date-picker-wrapper input,
.stbp-staff-selection select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--stbp-border);
    border-radius: var(--stbp-radius);
    font-size: 16px;
}

.stbp-time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.stbp-time-slot {
    padding: 12px;
    border: 2px solid var(--stbp-border);
    border-radius: var(--stbp-radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.stbp-time-slot:hover:not(.disabled) {
    border-color: var(--stbp-primary);
    background-color: rgba(76, 175, 80, 0.05);
}

.stbp-time-slot.selected {
    border-color: var(--stbp-primary);
    background-color: var(--stbp-primary);
    color: white;
}

.stbp-time-slot.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--stbp-light);
}

.stbp-placeholder {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* Customer Form */
.stbp-customer-form {
    display: grid;
    gap: 20px;
}

.stbp-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stbp-form-group {
    display: flex;
    flex-direction: column;
}

.stbp-form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--stbp-dark);
}

.stbp-form-group input,
.stbp-form-group textarea {
    padding: 12px;
    border: 2px solid var(--stbp-border);
    border-radius: var(--stbp-radius);
    font-size: 16px;
    font-family: inherit;
}

.stbp-form-group input:focus,
.stbp-form-group textarea:focus {
    outline: none;
    border-color: var(--stbp-primary);
}

/* Booking Summary */
.stbp-booking-summary {
    background: var(--stbp-light);
    border-radius: var(--stbp-radius);
    padding: 20px;
}

.stbp-summary-section {
    padding: 15px 0;
    border-bottom: 1px solid var(--stbp-border);
}

.stbp-summary-section:last-child {
    border-bottom: none;
}

.stbp-summary-section h4 {
    margin: 0 0 5px;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.stbp-summary-section p {
    margin: 0;
    color: var(--stbp-dark);
    font-size: 16px;
}

.stbp-summary-total {
    padding-top: 20px;
}

.stbp-summary-total .stbp-price {
    font-size: 28px;
    font-weight: bold;
    color: var(--stbp-primary);
}

/* Buttons */
.stbp-btn {
    padding: 12px 30px;
    border: none;
    border-radius: var(--stbp-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.stbp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stbp-btn-primary {
    background: var(--stbp-primary);
    color: white;
}

.stbp-btn-primary:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.stbp-btn-secondary {
    background: var(--stbp-secondary);
    color: white;
}

.stbp-btn-secondary:hover:not(:disabled) {
    background: #1976D2;
}

.stbp-btn-success {
    background: var(--stbp-success);
    color: white;
}

.stbp-btn-success:hover:not(:disabled) {
    background: #45a049;
}

.stbp-btn-danger {
    background: var(--stbp-danger);
    color: white;
}

.stbp-btn-danger:hover:not(:disabled) {
    background: #da190b;
}

/* Form Actions */
.stbp-form-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--stbp-light);
}

.stbp-form-actions .stbp-btn {
    flex: 1;
}

/* Progress Bar */
.stbp-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--stbp-light);
}

.stbp-progress-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.stbp-progress-step::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--stbp-border);
    z-index: 0;
}

.stbp-progress-step:first-child::before {
    display: none;
}

.stbp-progress-step.active::before {
    background: var(--stbp-primary);
}

.stbp-step-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background: var(--stbp-light);
    color: #999;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.stbp-progress-step.active .stbp-step-number {
    background: var(--stbp-primary);
    color: white;
}

.stbp-step-label {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #999;
}

.stbp-progress-step.active .stbp-step-label {
    color: var(--stbp-primary);
    font-weight: 600;
}

/* Messages */
.stbp-message {
    text-align: center;
    padding: 40px;
    border-radius: var(--stbp-radius);
}

.stbp-message-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.stbp-success {
    background: rgba(76, 175, 80, 0.1);
    border: 2px solid var(--stbp-success);
}

.stbp-success .stbp-message-icon {
    color: var(--stbp-success);
}

.stbp-error {
    background: rgba(244, 67, 54, 0.1);
    border: 2px solid var(--stbp-danger);
}

.stbp-error .stbp-message-icon {
    color: var(--stbp-danger);
}

/* Services List */
.stbp-services-wrapper {
    padding: 20px 0;
}

.stbp-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.stbp-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stbp-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stbp-service-item {
    border: 1px solid var(--stbp-border);
    border-radius: var(--stbp-radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

.stbp-service-item:hover {
    box-shadow: var(--stbp-shadow);
    transform: translateY(-5px);
}

.stbp-service-body {
    padding: 20px;
}

.stbp-service-title {
    margin: 0 0 10px;
    font-size: 20px;
}

.stbp-service-desc {
    color: #666;
    margin: 0 0 15px;
    line-height: 1.6;
}

.stbp-service-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 10px 0;
    border-top: 1px solid var(--stbp-light);
    border-bottom: 1px solid var(--stbp-light);
}

.stbp-book-now {
    width: 100%;
}

/* My Bookings */
.stbp-my-bookings-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.stbp-no-bookings {
    text-align: center;
    padding: 60px 20px;
}

.stbp-bookings-list {
    display: grid;
    gap: 20px;
}

.stbp-booking-item {
    background: white;
    border-radius: var(--stbp-radius);
    box-shadow: var(--stbp-shadow);
    padding: 20px;
    border-left: 4px solid var(--stbp-border);
}

.stbp-booking-item.stbp-status-pending {
    border-left-color: var(--stbp-warning);
}

.stbp-booking-item.stbp-status-confirmed {
    border-left-color: var(--stbp-info);
}

.stbp-booking-item.stbp-status-completed {
    border-left-color: var(--stbp-success);
}

.stbp-booking-item.stbp-status-cancelled {
    border-left-color: var(--stbp-danger);
    opacity: 0.7;
}

.stbp-booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--stbp-light);
}

.stbp-booking-header h3 {
    margin: 0;
    font-size: 20px;
}

.stbp-booking-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.stbp-booking-status.stbp-status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.stbp-booking-status.stbp-status-confirmed {
    background: rgba(33, 150, 243, 0.2);
    color: #0C5460;
}

.stbp-booking-status.stbp-status-completed {
    background: rgba(76, 175, 80, 0.2);
    color: #155724;
}

.stbp-booking-status.stbp-status-cancelled {
    background: rgba(244, 67, 54, 0.2);
    color: #721C24;
}

.stbp-booking-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.stbp-booking-info {
    display: flex;
    flex-direction: column;
}

.stbp-info-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stbp-info-value {
    font-size: 16px;
    color: var(--stbp-dark);
}

.stbp-booking-notes {
    background: var(--stbp-light);
    padding: 15px;
    border-radius: var(--stbp-radius);
    margin: 15px 0;
}

.stbp-booking-notes strong {
    display: block;
    margin-bottom: 5px;
}

.stbp-booking-notes p {
    margin: 0;
    color: #666;
}

.stbp-booking-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--stbp-light);
}

/* Responsive */
@media (max-width: 768px) {
    .stbp-services-grid,
    .stbp-columns-2,
    .stbp-columns-3,
    .stbp-columns-4 {
        grid-template-columns: 1fr;
    }
    
    .stbp-form-row {
        grid-template-columns: 1fr;
    }
    
    .stbp-form-actions {
        flex-direction: column;
    }
    
    .stbp-progress-bar {
        flex-wrap: wrap;
    }
    
    .stbp-progress-step {
        flex: 0 0 50%;
        margin-bottom: 20px;
    }
    
    .stbp-booking-details {
        grid-template-columns: 1fr;
    }
}

/* Loading Spinner */
.stbp-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}