/**
 * ITG Lesson Booking - CSS Styling
 * Pure CSS styling for lesson booking widget
 */

/* ===========================
   Variables & Reset
   =========================== */
:root {
    --itg-primary: #2d5f3f;
    --itg-primary-light: #3d7a4f;
    --itg-accent: #95c11f;
    --itg-gray-50: #f8fafc;
    --itg-gray-100: #f1f5f9;
    --itg-gray-200: #e2e8f0;
    --itg-gray-400: #94a3b8;
    --itg-gray-500: #64748b;
    --itg-gray-700: #334155;
    --itg-gray-900: #0f172a;
    --itg-red: #ef4444;
    --itg-green: #22c55e;
}

.itg-lesson-booking-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: var(--itg-gray-700);
    padding: 0 !important;
    margin: 0 auto !important;
    max-width: 1200px;
}

/* ===========================
   Utility Classes
   =========================== */
.itg-hidden {
    display: none !important;
}

.itg-text-center {
    text-align: center;
}

.itg-mt-4 {
    margin-top: 1rem;
}

.itg-mb-4 {
    margin-bottom: 1rem;
}

/* ===========================
   Filters Section
   =========================== */
.itg-filters {
    background: white;
    border-radius: 0;
    padding: 16px;
    margin-bottom: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--itg-gray-200);
}

.itg-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.itg-filters-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--itg-primary);
}

.itg-filters-actions {
    display: flex;
    gap: 12px;
}

.itg-btn-reset {
    background: transparent;
    border: 1px solid var(--itg-gray-200);
    border-radius: 6px;
    padding: 8px 16px;
    color: var(--itg-gray-500);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.itg-btn-reset:hover {
    background: var(--itg-gray-50);
    border-color: var(--itg-gray-400);
}

.itg-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.itg-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.itg-form-label {
    font-weight: 500;
    font-size: 14px;
    color: var(--itg-gray-700);
}

.itg-form-select,
.itg-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--itg-gray-200);
    border-radius: 6px;
    font-size: 14px;
    color: var(--itg-gray-700);
    background: white;
    transition: all 0.2s;
}

.itg-form-select:focus,
.itg-form-input:focus {
    outline: none;
    border-color: var(--itg-primary);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

/* ===========================
   Slots Table
   =========================== */
.itg-slots-container {
    background: white;
    border-radius: 0;
    padding: 16px;
    box-shadow: none;
    margin-bottom: 0;
}

.itg-slots-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--itg-gray-200);
}

.itg-slots-title {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--itg-primary);
}

.itg-slots-info {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--itg-gray-500);
}

.itg-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.itg-slots-table-wrapper {
    overflow-x: auto;
    margin: 0;
    padding: 0;
}

.itg-slots-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--itg-gray-200);
}

.itg-slots-table th {
    background: var(--itg-gray-50);
    padding: 16px 12px;
    text-align: center;
    font-weight: 600;
    color: var(--itg-primary);
    border-bottom: 2px solid var(--itg-gray-200);
    white-space: nowrap;
}

.itg-slots-table th:first-child {
    background: var(--itg-primary);
    color: white;
    width: 100px;
}

.itg-slots-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--itg-gray-100);
}

.itg-slots-table td:first-child {
    background: var(--itg-gray-50);
    font-weight: 600;
    color: var(--itg-primary);
    border-right: 1px solid var(--itg-gray-200);
}

.itg-slot-button {
    background: transparent;
    border: 2px solid var(--itg-primary);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    min-height: 44px;
    color: var(--itg-primary);
    font-size: 12px;
    font-weight: 500;
}

.itg-slot-button:hover {
    background: var(--itg-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(45, 95, 63, 0.2);
}

.itg-slot-empty {
    color: var(--itg-gray-400);
    font-style: italic;
    font-size: 20px;
}

/* ===========================
   Booking Form
   =========================== */
.itg-booking-form {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.itg-booking-header {
    background: linear-gradient(135deg, var(--itg-primary) 0%, var(--itg-primary-light) 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(45, 95, 63, 0.3);
}

.itg-booking-header h2 {
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 12px;
}

.itg-lesson-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 15px;
}

.itg-form-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(149, 193, 31, 0.1);
}

.itg-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--itg-primary);
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(149, 193, 31, 0.2);
}

.itg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.itg-form-row.full-width {
    grid-template-columns: 1fr;
}

.itg-form-input[type="text"],
.itg-form-input[type="email"],
.itg-form-input[type="tel"],
.itg-form-input[type="number"],
.itg-form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--itg-gray-200);
    border-radius: 6px;
    font-size: 14px;
    color: var(--itg-gray-700);
    background: white;
    transition: all 0.2s;
}

.itg-form-textarea {
    min-height: 80px;
    resize: vertical;
}

.itg-form-input.error,
.itg-form-textarea.error {
    border-color: var(--itg-red);
}

.itg-error-message {
    color: var(--itg-red);
    font-size: 12px;
    margin-top: 4px;
}

/* Checkbox styling */
.itg-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
}

.itg-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.itg-checkbox-label {
    cursor: pointer;
    font-size: 14px;
    color: var(--itg-gray-700);
    font-weight: 500;
}

/* Terms container */
.itg-terms-scroll {
    border: 1px solid var(--itg-gray-200);
    border-radius: 8px;
    height: 180px;
    overflow-y: auto;
    padding: 16px;
    margin-bottom: 16px;
    background: var(--itg-gray-50);
    font-size: 14px;
    line-height: 1.5;
}

.itg-terms-scroll .title_lv {
    color: var(--itg-accent) !important;
    font-weight: bold;
    font-size: 16px;
}

/* ===========================
   Buttons & Actions
   =========================== */
.itg-booking-actions {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid var(--itg-gray-200);
    margin-top: 20px;
}

.itg-btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--itg-gray-100);
    color: var(--itg-gray-500);
    border: 1px solid var(--itg-gray-200);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.itg-btn-back:hover {
    background: var(--itg-gray-200);
    color: var(--itg-gray-700);
}

.itg-btn-book {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--itg-accent) 0%, #7ea518 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 200px;
    justify-content: center;
}

.itg-btn-book:hover:not(:disabled) {
    background: linear-gradient(135deg, #7ea518 0%, #6b8f15 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(149, 193, 31, 0.3);
}

.itg-btn-book:disabled {
    background: var(--itg-gray-400);
    color: white;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===========================
   Empty States & Messages
   =========================== */
.itg-empty-state,
.itg-initial-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    color: var(--itg-gray-500);
    text-align: center;
}

.itg-empty-state .icon,
.itg-initial-state .icon {
    font-size: 64px;
    color: var(--itg-gray-200);
    margin-bottom: 16px;
}

.itg-empty-state p,
.itg-initial-state p {
    font-size: 18px;
    margin-bottom: 24px;
}

.itg-success-message {
    background: var(--itg-green);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.itg-error-box {
    background: #fee;
    border: 1px solid var(--itg-red);
    color: #c00;
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* ===========================
   Loading State
   =========================== */
.itg-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--itg-gray-500);
}

.itg-loading p {
    margin-top: 16px;
    font-size: 16px;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1240px) {
    .itg-lesson-booking-widget {
        margin: 0 20px !important;
    }
}

@media (max-width: 768px) {
    .itg-lesson-booking-widget {
        margin: 0 !important;
    }

    .itg-filters-grid {
        grid-template-columns: 1fr;
    }

    .itg-form-row {
        grid-template-columns: 1fr;
    }

    .itg-slots-table th,
    .itg-slots-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .itg-booking-actions {
        flex-direction: column;
    }

    .itg-btn-book {
        min-width: auto;
        width: 100%;
    }

    .itg-filters {
        padding: 12px;
    }

    .itg-slots-container {
        padding: 12px;
    }

    .itg-slots-table-wrapper {
        margin: 0;
        padding: 0;
    }
}

@media (max-width: 480px) {
    .itg-filters {
        padding: 12px;
    }

    .itg-slots-container {
        padding: 12px;
    }

    .itg-booking-header {
        padding: 16px;
    }

    .itg-form-section {
        padding: 16px;
    }

    .itg-filters-title,
    .itg-slots-title {
        font-size: 18px;
    }

    .itg-slot-button {
        font-size: 10px;
        padding: 6px 8px;
    }
}
