/**
 * CGHI Appointment Form Styles
 * ระบบนัดหมายแพทย์ - Responsive CSS
 */

/* ===== Container & Wrapper ===== */
.cghi-appointment-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.cghi-appointment-container {
/*     max-width: 960px; */
    margin: 0 auto;
/*     background: #ffffff;
    border: 2px solid #2c7a5e;
    border-radius: 12px; */
    padding: 40px;
/*     box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); */
}

/* ===== Typography ===== */
.cghi-form-title {
    font-size: 40px;
    font-weight: 600;
    color: #275B47;
    margin: 0 0 10px 0;
    text-align: left;
}

.cghi-form-description {
    font-size: 20px;
    color: #275B47;
    margin: 0 0 30px 0;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* ===== Messages ===== */
.cghi-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.5;
}

.cghi-message-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.cghi-message-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ===== Form Structure ===== */
.cghi-appointment-form {
    width: 100%;
}

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

.cghi-form-group {
    display: flex;
    flex-direction: column;
}

.cghi-form-group-full {
    grid-column: 1 / -1;
}

.cghi-form-group-half {
    grid-column: span 1;
}

/* ===== Labels ===== */
.cghi-form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.required {
    color: #dc3545;
    margin-left: 3px;
}

/* ===== Input Fields ===== */
.cghi-form-group input[type="text"],
.cghi-form-group input[type="email"],
.cghi-form-group input[type="tel"],
.cghi-form-group input[type="date"],
.cghi-form-group select,
.cghi-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.cghi-form-group input:focus,
.cghi-form-group select:focus,
.cghi-form-group textarea:focus {
    outline: none;
    border-color: #2c7a5e;
    box-shadow: 0 0 0 3px rgba(44, 122, 94, 0.1);
}

.cghi-form-group input::placeholder,
.cghi-form-group textarea::placeholder {
    color: #9ca3af;
}

/* ===== Select Dropdown ===== */
.cghi-form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.cghi-form-group select:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== Textarea ===== */
.cghi-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===== Error State ===== */
.cghi-form-group input.error,
.cghi-form-group select.error,
.cghi-form-group textarea.error {
    border-color: #dc3545;
}

.cghi-form-group input.error:focus,
.cghi-form-group select.error:focus,
.cghi-form-group textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* ===== Submit Button ===== */
.cghi-submit-btn {
    width: 100%;
    max-width: 300px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background-color: #2c7a5e;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-block;
}

.cghi-submit-btn:hover {
    background-color: #235f49;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(44, 122, 94, 0.3);
}

.cghi-submit-btn:active {
    transform: translateY(0);
}

.cghi-submit-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* ===== Date Input Styling ===== */
.cghi-form-group input[type="date"] {
    position: relative;
}

.cghi-form-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

.cghi-form-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* ===== Responsive Design ===== */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .cghi-appointment-container {
        padding: 30px 25px;
    }
    
    .cghi-form-title {
        font-size: 24px;
    }
    
    .cghi-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cghi-form-group-half {
        grid-column: 1 / -1;
    }
    
    .cghi-submit-btn {
        max-width: 100%;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .cghi-appointment-wrapper {
        padding: 15px;
    }
    
    .cghi-appointment-container {
        padding: 25px 20px;
        border-radius: 8px;
    }
    
    .cghi-form-title {
        font-size: 22px;
    }
    
    .cghi-form-description {
        font-size: 13px;
    }
    
    .cghi-form-group input[type="text"],
    .cghi-form-group input[type="email"],
    .cghi-form-group input[type="tel"],
    .cghi-form-group input[type="date"],
    .cghi-form-group select,
    .cghi-form-group textarea {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .cghi-form-group label {
        font-size: 13px;
    }
    
    .cghi-submit-btn {
        padding: 12px 24px;
        font-size: 15px;
    }
}

/* ===== Loading State ===== */
.cghi-form-group.loading select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%239ca3af' d='M10 3a7 7 0 100 14 7 7 0 000-14zm0 12a5 5 0 110-10 5 5 0 010 10z'/%3E%3C/svg%3E");
    background-size: 16px;
}

/* ===== Accessibility ===== */
.cghi-form-group input:focus-visible,
.cghi-form-group select:focus-visible,
.cghi-form-group textarea:focus-visible {
    outline: 2px solid #2c7a5e;
    outline-offset: 2px;
}

/* ===== Print Styles ===== */
@media print {
    .cghi-submit-btn {
        display: none;
    }
    
    .cghi-appointment-container {
        border: 1px solid #000;
        box-shadow: none;
    }
}
