/* MOFA Website Design - Citizens Form */
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.cdnfonts.com/css/helvetica-neue-55');
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Hide ASP.NET navbar and footer for citizen form */
body .navbar,
body .navbar-inverse,
body .navbar-fixed-top {
    display: none !important;
}

body {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.citizen-form-container ~ footer,
.body-content > footer {
    display: none !important;
}

.body-content hr {
    display: none !important;
}

/* Override Site.css for form container */
.citizen-form-container .body-content {
    padding: 0 !important;
}

.citizen-form-container input,
.citizen-form-container select,
.citizen-form-container textarea {
    max-width: 100% !important;
}

:root {
    --primary-color: #C8102E; /* Bahrain Red - MOFA Brand Color */
    --primary-dark: #A00D26;
    --primary-light: #E63946;
    --secondary-color: #000000;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #E0E0E0;
    --background-light: #F8F9FA;
    --background-white: #FFFFFF;
    --success-color: #28A745;
    --error-color: #DC3545;
    --warning-color: #FFC107;
    --font-english: 'Public Sans', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --font-arabic: 'Noto Sans Arabic', 'Cairo', Arial, sans-serif;
}

body {
    font-family: var(--font-english);
    color: var(--text-color);
    background-color: var(--background-light);
    line-height: 1.6;
    direction: rtl;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.arabic-text {
    font-family: var(--font-arabic);
    direction: rtl;
}

/* Container */
.citizen-form-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: var(--background-light);
}

/* Ensure body-content doesn't interfere */
.body-content .citizen-form-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.form-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--background-white);
    padding: 30px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    border-radius: 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.logo-section {
    text-align: center;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    font-family: var(--font-english);
    letter-spacing: 0;
    text-transform: none;
}

.logo-arabic {
    font-size: 24px;
    font-weight: 600;
    font-family: var(--font-arabic);
    opacity: 0.95;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-bottom: 40px;
    padding: 0 40px;
}

/* Intro Section */
.intro-section {
    background: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    text-align: center;
    border: none;
}

.intro-section .card-body {
    padding: 30px;
}

.title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-family: var(--font-english);
    letter-spacing: 0;
    text-transform: none;
}

.title-arabic {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-family: var(--font-arabic);
}

.description {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.8;
    font-family: var(--font-english);
}

.description-arabic {
    font-size: 16px;
    color: var(--text-light);
    font-family: var(--font-arabic);
    line-height: 1.8;
}

/* Form Styles */
.registration-form {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.form-section {
    margin-bottom: 30px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background: var(--background-white);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.form-section .card-body {
    padding: 30px;
}

.form-section:last-of-type {
    margin-bottom: 0;
}

/* Bootstrap Card Overrides */
.card {
    border: none;
    border-radius: 8px;
}

.card-body {
    padding: 30px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    font-family: var(--font-english);
    letter-spacing: 0;
    text-transform: none;
    margin-top: 0;
}

.section-label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
    line-height: 1.6;
    font-family: var(--font-english);
}

.required {
    color: var(--error-color);
    margin-right: 5px;
    font-size: 18px;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
    line-height: 1.6;
    font-family: var(--font-english);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    font-family: var(--font-english);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--background-white);
    transition: all 0.3s ease;
    color: var(--text-color);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.form-input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.form-hint {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 5px;
    font-style: italic;
    font-family: var(--font-english);
}

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

/* Radio Buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 16px;
    font-family: var(--font-english);
}

.radio-label:hover {
    background-color: var(--background-light);
    border-color: var(--primary-color);
}

.radio-label input[type="radio"] {
    margin-left: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.radio-label input[type="radio"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background-color: rgba(200, 16, 46, 0.05);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 15px;
    line-height: 1.8;
    font-family: var(--font-english);
}

.checkbox-label:hover {
    background-color: var(--background-light);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"] {
    margin-left: 12px;
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

/* Note Box */
.note-box {
    background-color: var(--background-light);
    border-right: 4px solid var(--primary-color);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.8;
}

.note-box p {
    margin-bottom: 8px;
    font-family: var(--font-english);
}

.note-box p:last-child {
    margin-bottom: 0;
}

.note-box .arabic-text {
    font-family: var(--font-arabic);
}

/* File Upload */
.file-upload-wrapper {
    margin-bottom: 20px;
    padding: 15px;
    border: 2px dashed #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

.file-upload-wrapper:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.file-upload-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

.file-upload-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
}

.file-upload-input:hover {
    border-color: #007bff;
}

.file-upload-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.file-error-message {
    display: none;
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 3px;
}

/* Person Section Enhancements */
.person-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.person-header-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    flex: 1;
}

.btn-remove-person {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.btn-remove-person:hover {
    background-color: #c82333;
    transform: scale(1.1);
}

.btn-remove-person:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

/* Loading/Processing State */
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success Message Enhancements */
.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 64px;
    color: #28a745;
    display: block;
    margin-bottom: 20px;
}

.success-content h3 {
    color: #28a745;
    margin-bottom: 15px;
}

.success-content p {
    font-size: 16px;
    margin-bottom: 10px;
}

.success-content strong {
    font-size: 20px;
    color: var(--primary-color);
}

/* Error Messages */
.error-message {
    display: block;
    color: var(--error-color);
    font-size: 14px;
    margin-top: 5px;
    min-height: 20px;
    font-family: var(--font-english);
}

.duplicate-warning {
    display: block;
    background-color: #FFF3CD;
    border: 1px solid var(--warning-color);
    color: #856404;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-english);
}

.duplicate-warning .arabic-text {
    font-family: var(--font-arabic);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-english);
    letter-spacing: 0;
    text-transform: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--background-white);
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
}

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

.btn-primary:disabled {
    background-color: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: var(--background-white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--background-white);
}

.form-actions {
    margin-top: 30px;
    margin-bottom: 30px;
    text-align: center;
}

/* Success Message */
.success-message {
    background: var(--background-white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
    text-align: center;
}

.success-content {
    max-width: 600px;
    margin: 0 auto;
}

.success-icon {
    display: inline-block;
    width: 80px;
    height: 80px;
    line-height: 80px;
    background-color: var(--success-color);
    color: var(--background-white);
    border-radius: 50%;
    font-size: 48px;
    margin-bottom: 20px;
}

.success-content h3 {
    font-size: 24px;
    color: var(--success-color);
    margin-bottom: 15px;
    font-family: var(--font-english);
    font-weight: 700;
}

.success-content p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.8;
    font-family: var(--font-english);
}

/* Member Card */
.member-card {
    background-color: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.member-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.member-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    font-family: var(--font-english);
}

.remove-member-btn {
    background-color: var(--error-color);
    color: var(--background-white);
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: var(--font-english);
}

.remove-member-btn:hover {
    background-color: #C82333;
}

/* Footer */
.form-footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-light);
    font-size: 14px;
    font-family: var(--font-english);
    margin-top: 40px;
    background-color: var(--background-white);
    border-top: 1px solid var(--border-color);
    padding: 30px 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .citizen-form-container {
        padding: 0 15px;
    }

    .form-header {
        padding: 20px 0;
        margin-left: 0;
        margin-right: 0;
        margin-top: 0;
    }
    
    .header-content {
        padding: 0 20px;
    }
    
    .main-content {
        padding: 0 20px;
    }
    
    .form-footer {
        padding: 20px;
    }

    .logo {
        font-size: 22px;
    }

    .logo-arabic {
        font-size: 20px;
    }

    .intro-section .card-body {
        padding: 20px;
    }
    
    .form-section .card-body {
        padding: 20px;
    }

    .title {
        font-size: 24px;
    }

    .title-arabic {
        font-size: 22px;
    }

    .registration-form {
        padding: 0;
    }
    
    .card-body {
        padding: 20px !important;
    }

    .section-title {
        font-size: 20px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .radio-group {
        gap: 8px;
    }

    .radio-label {
        padding: 10px;
        font-size: 15px;
    }

    .file-upload-label {
        padding: 30px 15px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 20px;
    }

    .title-arabic {
        font-size: 18px;
    }

    .section-label,
    .form-label {
        font-size: 15px;
    }

    .member-card {
        padding: 15px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .form-header,
    .form-footer,
    .form-actions {
        display: none;
    }

    .registration-form {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* File Upload Styling - Enhanced */
.file-upload-wrapper {
    margin-bottom: 20px;
    padding: 15px;
    border: 2px dashed #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

.file-upload-wrapper:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.file-upload-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

.file-upload-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
}

.file-upload-input:hover {
    border-color: #007bff;
}

.file-upload-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.file-error-message {
    display: none;
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 3px;
}

/* Person Section Enhancements */
.person-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.person-header-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    flex: 1;
}

.btn-remove-person {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.btn-remove-person:hover {
    background-color: #c82333;
    transform: scale(1.1);
}

.btn-remove-person:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

/* Loading/Processing State */
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success Message Enhancements */
.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 64px;
    color: #28a745;
    display: block;
    margin-bottom: 20px;
}

.success-content h3 {
    color: #28a745;
    margin-bottom: 15px;
}

.success-content p {
    font-size: 16px;
    margin-bottom: 10px;
}

.success-content strong {
    font-size: 20px;
    color: var(--primary-color);
}
