/**
 * Texas Choice HVAC Widget Styles
 */

/* CSS Variables - Texas Choice HVAC Default Theme */
:root {
    --tc-primary: #e72420;
    --tc-primary-hover: #c91f1b;
    --tc-secondary: #6c757d;
    --tc-success: #28a745;
    --tc-success-hover: #218838;
    --tc-danger: #dc3545;
    --tc-warning: #ffc107;
    --tc-info: #17a2b8;
    --tc-light: #f8f9fa;
    --tc-dark: #343a40;
    --tc-white: #ffffff;
    --tc-gray-100: #f8f9fa;
    --tc-gray-200: #e9ecef;
    --tc-gray-300: #dee2e6;
    --tc-gray-400: #ced4da;
    --tc-gray-500: #adb5bd;
    --tc-gray-600: #6c757d;
    --tc-border-radius: 8px;
    --tc-border-radius-lg: 12px;
    --tc-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --tc-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
    --tc-transition: all 0.2s ease;
    --tc-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Allow inline overrides from shortcode settings */
.tc-hvac-widget {
    --tc-primary: #e72420;
    --tc-primary-hover: #c91f1b;
}

/* Reset */
.tc-hvac-widget,
.tc-hvac-widget * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.tc-hvac-widget {
    font-family: var(--tc-font-family);
    font-size: 14px;
    line-height: 1.5;
    color: var(--tc-dark);
}

/* Trigger Button */
.tc-widget-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--tc-border-radius);
    cursor: pointer;
    transition: var(--tc-transition);
    border: none;
}

.tc-widget-trigger i {
    font-size: 18px;
}

/* Button Styles */
.tc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--tc-border-radius);
    border: none;
    cursor: pointer;
    transition: var(--tc-transition);
    text-decoration: none;
    font-family: var(--tc-font-family);
}

.tc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tc-btn-primary {
    background: var(--tc-primary);
    color: var(--tc-white);
}

.tc-btn-primary:hover:not(:disabled) {
    background: var(--tc-primary-hover);
}

.tc-btn-secondary {
    background: var(--tc-gray-200);
    color: var(--tc-dark);
}

.tc-btn-secondary:hover:not(:disabled) {
    background: var(--tc-gray-300);
}

.tc-btn-success {
    background: var(--tc-success);
    color: var(--tc-white);
}

.tc-btn-success:hover:not(:disabled) {
    background: var(--tc-success-hover);
}

.tc-btn-block {
    width: 100%;
}

/* Modal */
.tc-widget-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.tc-widget-modal.active {
    display: flex;
}

.tc-widget-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: var(--tc-white);
    border-radius: var(--tc-border-radius-lg);
    box-shadow: var(--tc-shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

/* Header */
.tc-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--tc-gray-200);
    position: sticky;
    top: 0;
    background: var(--tc-white);
    z-index: 10;
    border-radius: var(--tc-border-radius-lg) var(--tc-border-radius-lg) 0 0;
}

.tc-widget-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--tc-dark);
    margin: 0;
}

.tc-widget-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tc-gray-100);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--tc-transition);
    color: var(--tc-gray-600);
}

.tc-widget-close:hover {
    background: var(--tc-gray-200);
    color: var(--tc-dark);
}

/* Progress Steps */
.tc-widget-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
    background: var(--tc-gray-100);
}

.tc-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.tc-step-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tc-gray-300);
    color: var(--tc-gray-600);
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
    transition: var(--tc-transition);
}

.tc-progress-step.active .tc-step-number,
.tc-progress-step.completed .tc-step-number {
    background: var(--tc-primary);
    color: var(--tc-white);
}

.tc-progress-step.completed .tc-step-number {
    background: var(--tc-success);
}

.tc-step-label {
    font-size: 12px;
    color: var(--tc-gray-600);
    font-weight: 500;
}

.tc-progress-step.active .tc-step-label {
    color: var(--tc-primary);
}

.tc-progress-line {
    width: 40px;
    height: 2px;
    background: var(--tc-gray-300);
    margin: 0 8px;
    margin-bottom: 20px;
}

/* Steps */
.tc-widget-step {
    display: none;
    padding: 24px;
}

.tc-widget-step.active {
    display: block;
}

.tc-step-content {
    text-align: center;
}

.tc-step-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--tc-dark);
    margin-bottom: 8px;
}

.tc-step-description {
    color: var(--tc-gray-600);
    margin-bottom: 24px;
}

.tc-step-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tc-primary);
    color: var(--tc-white);
    border-radius: 50%;
    font-size: 28px;
    margin: 0 auto 20px;
}

/* Zip Input */
.tc-zip-input {
    max-width: 200px;
    margin: 0 auto;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 4px;
    padding: 16px;
}

.tc-zip-feedback {
    margin-top: 12px;
    font-size: 14px;
    min-height: 24px;
}

.tc-zip-feedback.success {
    color: var(--tc-success);
}

.tc-zip-feedback.error {
    color: var(--tc-danger);
}

/* Form Controls */
.tc-form-group {
    margin-bottom: 16px;
    text-align: left;
}

.tc-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--tc-dark);
    margin-bottom: 6px;
}

.tc-required {
    color: var(--tc-danger);
}

.tc-form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--tc-font-family);
    border: 1px solid var(--tc-gray-300);
    border-radius: var(--tc-border-radius);
    transition: var(--tc-transition);
    background: var(--tc-white);
}

.tc-form-control:focus {
    outline: none;
    border-color: var(--tc-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.tc-form-row {
    margin-bottom: 0;
}

.tc-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

textarea.tc-form-control {
    resize: vertical;
    min-height: 80px;
}

/* Category Tabs */
.tc-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.tc-category-tab {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: var(--tc-gray-100);
    border: 1px solid var(--tc-gray-300);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--tc-transition);
    font-family: var(--tc-font-family);
}

.tc-category-tab:hover {
    background: var(--tc-gray-200);
}

.tc-category-tab.active {
    background: var(--tc-primary);
    color: var(--tc-white);
    border-color: var(--tc-primary);
}

/* Services Grid */
.tc-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    text-align: left;
}

.tc-service-card {
    padding: 16px;
    background: var(--tc-gray-100);
    border: 2px solid transparent;
    border-radius: var(--tc-border-radius);
    cursor: pointer;
    transition: var(--tc-transition);
}

.tc-service-card:hover {
    background: var(--tc-gray-200);
}

.tc-service-card.selected {
    border-color: var(--tc-primary);
    background: rgba(0, 102, 204, 0.05);
}

.tc-service-name {
    font-weight: 600;
    color: var(--tc-dark);
    margin-bottom: 4px;
    font-size: 14px;
}

.tc-service-price {
    color: var(--tc-primary);
    font-weight: 600;
    font-size: 16px;
}

.tc-service-duration {
    color: var(--tc-gray-600);
    font-size: 12px;
}

/* Step Actions */
.tc-step-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.tc-step-actions .tc-btn {
    flex: 1;
}

/* Booking Summary */
.tc-booking-summary {
    background: var(--tc-gray-100);
    border-radius: var(--tc-border-radius);
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.tc-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--tc-gray-200);
}

.tc-summary-row:last-child {
    border-bottom: none;
}

.tc-summary-label {
    color: var(--tc-gray-600);
    font-size: 14px;
}

.tc-summary-value {
    font-weight: 500;
    color: var(--tc-dark);
    text-align: right;
}

/* Price Breakdown */
.tc-price-breakdown {
    background: var(--tc-white);
    border: 1px solid var(--tc-gray-300);
    border-radius: var(--tc-border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.tc-price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.tc-price-row.total {
    border-top: 2px solid var(--tc-gray-300);
    margin-top: 8px;
    padding-top: 16px;
    font-size: 18px;
    font-weight: 600;
}

.tc-price-label {
    color: var(--tc-gray-600);
}

.tc-price-row.total .tc-price-label {
    color: var(--tc-dark);
}

.tc-price-value {
    font-weight: 500;
    color: var(--tc-dark);
}

.tc-price-row.total .tc-price-value {
    color: var(--tc-success);
}

/* Success State */
.tc-success-content {
    padding: 40px 24px;
}

.tc-success-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tc-success);
    color: var(--tc-white);
    border-radius: 50%;
    font-size: 40px;
    margin: 0 auto 24px;
    animation: tc-scale-in 0.3s ease;
}

@keyframes tc-scale-in {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.tc-booking-number {
    background: var(--tc-gray-100);
    border-radius: var(--tc-border-radius);
    padding: 16px 24px;
    margin: 20px 0;
    display: inline-block;
}

.tc-booking-number-label {
    font-size: 12px;
    color: var(--tc-gray-600);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tc-booking-number-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--tc-primary);
    margin-top: 4px;
}

.tc-confirmation-note {
    color: var(--tc-gray-600);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Loading Overlay */
.tc-loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
    border-radius: var(--tc-border-radius-lg);
}

.tc-loading-overlay.active {
    display: flex;
}

.tc-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--tc-gray-300);
    border-top-color: var(--tc-primary);
    border-radius: 50%;
    animation: tc-spin 0.8s linear infinite;
}

@keyframes tc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .tc-widget-modal {
        padding: 10px;
    }

    .tc-widget-container {
        max-height: 95vh;
    }

    .tc-widget-header {
        padding: 16px;
    }

    .tc-widget-title {
        font-size: 18px;
    }

    .tc-widget-progress {
        padding: 16px;
    }

    .tc-step-label {
        display: none;
    }

    .tc-progress-line {
        margin-bottom: 0;
    }

    .tc-widget-step {
        padding: 20px 16px;
    }

    .tc-form-row-2 {
        grid-template-columns: 1fr;
    }

    .tc-services-grid {
        grid-template-columns: 1fr;
    }

    .tc-step-actions {
        flex-direction: column-reverse;
    }

    .tc-category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: 8px;
    }

    .tc-category-tab {
        flex-shrink: 0;
    }
}

/* Print Styles */
@media print {
    .tc-widget-modal {
        position: static;
        background: none;
    }

    .tc-widget-close,
    .tc-step-actions {
        display: none;
    }
}
