/**
 * Frontend Styles for Hajj & Umrah Forms
 * Version: 3.9
 * Authors: Edwin Boiten & Claude (Anthropic)
 */

/* HTML Block Content */
.hajj-html-block-content {
    padding: 10px 0;
    color: #333;
    line-height: 1.6;
}

.hajj-html-block-content h3 {
    margin: 10px 0;
    color: #1a1a1a;
    font-size: 20px;
    font-weight: 600;
}

.hajj-html-block-content p {
    margin: 8px 0;
}

.hajj-html-block-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.hajj-html-block-content strong {
    font-weight: 600;
}

.hajj-html-block-content em {
    font-style: italic;
}

.hajj-form-container {
    max-width: 700px;
    margin: 40px auto;
    padding: 0 20px;
}

.hajj-form-wrapper {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.hajj-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.hajj-form-header h2 {
    margin: 0 0 10px 0;
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 600;
}

.hajj-form-header p {
    margin: 0;
    color: #666;
    font-size: 15px;
}

.hajj-umrah-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Grid Layout System */
.hajj-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 0;
}

.hajj-form-field {
    display: flex;
    flex-direction: column;
    flex: 1 1 100%;
    min-width: 0;
}

.hajj-form-field.hajj-field-full {
    flex: 1 1 100%;
}

.hajj-form-field.hajj-field-half {
    flex: 1 1 calc(50% - 10px);
}

.hajj-form-field.hajj-field-third {
    flex: 1 1 calc(33.333% - 14px);
}

.hajj-form-field.hajj-field-quarter {
    flex: 1 1 calc(25% - 15px);
}

.hajj-form-field label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.hajj-form-field label .required {
    color: #d63638;
    margin-left: 2px;
}

.hajj-form-field input[type="text"],
.hajj-form-field input[type="email"],
.hajj-form-field input[type="tel"],
.hajj-form-field input[type="number"],
.hajj-form-field input[type="date"],
.hajj-form-field select,
.hajj-form-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
}

.hajj-form-field input:focus,
.hajj-form-field select:focus,
.hajj-form-field textarea:focus {
    outline: none;
    border-color: #2271b1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.hajj-form-field textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.hajj-form-field 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 15px center;
    padding-right: 40px;
}

/* Checkbox and Radio Styles */
.hajj-checkbox-group,
.hajj-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hajj-checkbox-label,
.hajj-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.hajj-checkbox-label:hover,
.hajj-radio-label:hover {
    background: #f5f5f5;
}

.hajj-checkbox-label input,
.hajj-radio-label input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.hajj-checkbox-label span,
.hajj-radio-label span {
    font-size: 15px;
    color: #333;
}

.hajj-form-actions {
    margin-top: 10px;
}

.hajj-submit-btn {
    width: 100%;
    padding: 15px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hajj-submit-btn:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.hajj-submit-btn:active {
    transform: translateY(0);
}

.hajj-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.hajj-form-message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
    animation: slideDown 0.3s ease;
}

.hajj-form-message.show {
    display: block;
}

.hajj-form-message.success {
    background: #edfaef;
    border-left: 4px solid #00a32a;
    color: #00a32a;
}

.hajj-form-message.error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    color: #d63638;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hajj-form-wrapper {
        padding: 25px 20px;
    }
    
    .hajj-form-header h2 {
        font-size: 24px;
    }
    
    .hajj-form-field input,
    .hajj-form-field select,
    .hajj-form-field textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Stack all fields on mobile */
    .hajj-form-field.hajj-field-half,
    .hajj-form-field.hajj-field-third,
    .hajj-form-field.hajj-field-quarter {
        flex: 1 1 100%;
    }
}

/* Loading state */
.hajj-umrah-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Validation errors */
.hajj-form-field.error input,
.hajj-form-field.error select,
.hajj-form-field.error textarea {
    border-color: #d63638;
}

.hajj-form-field .error-message {
    color: #d63638;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.hajj-form-field.error .error-message {
    display: block;
}

/* Help Text */
.hajj-field-help-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #646970;
    font-style: italic;
    line-height: 1.4;
}

.hajj-form-wrapper {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.hajj-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.hajj-form-header h2 {
    margin: 0 0 10px 0;
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 600;
}

.hajj-form-header p {
    margin: 0;
    color: #666;
    font-size: 15px;
}

.hajj-umrah-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hajj-form-field {
    display: flex;
    flex-direction: column;
}

.hajj-form-field label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.hajj-form-field label .required {
    color: #d63638;
    margin-left: 2px;
}

.hajj-form-field input[type="text"],
.hajj-form-field input[type="email"],
.hajj-form-field input[type="tel"],
.hajj-form-field input[type="number"],
.hajj-form-field input[type="date"],
.hajj-form-field select,
.hajj-form-field textarea {
    width: 100%;
    padding: 5px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
}

.hajj-form-field input:focus,
.hajj-form-field select:focus,
.hajj-form-field textarea:focus {
    outline: none;
    border-color: #2271b1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.hajj-form-field textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.hajj-form-field 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 15px center;
    padding-right: 40px;
}

.hajj-form-actions {
    margin-top: 10px;
}

.hajj-submit-btn {
    width: 100%;
    padding: 15px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hajj-submit-btn:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.hajj-submit-btn:active {
    transform: translateY(0);
}

.hajj-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.hajj-form-message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
    animation: slideDown 0.3s ease;
}

.hajj-form-message.show {
    display: block;
}

.hajj-form-message.success {
    background: #edfaef;
    border-left: 4px solid #00a32a;
    color: #00a32a;
}

.hajj-form-message.error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    color: #d63638;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hajj-form-wrapper {
        padding: 25px 20px;
    }
    
    .hajj-form-header h2 {
        font-size: 24px;
    }
    
    .hajj-form-field input,
    .hajj-form-field select,
    .hajj-form-field textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Loading state */
.hajj-umrah-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Validation errors */
.hajj-form-field.error input,
.hajj-form-field.error select,
.hajj-form-field.error textarea {
    border-color: #d63638;
}

.hajj-form-field .error-message {
    color: #d63638;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.hajj-form-field.error .error-message {
    display: block;
}

/* Help Text */
.hajj-field-help-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #646970;
    font-style: italic;
    line-height: 1.4;
}