/* IHM Application Form Styles */

:root {
    --ihm-primary: #1e3a5f;
    --ihm-secondary: #c9a227;
    --ihm-success: #28a745;
    --ihm-danger: #dc3545;
    --ihm-warning: #ffc107;
    --ihm-info: #17a2b8;
    --ihm-gray: #6c757d;
    --ihm-light: #f8f9fa;
    --ihm-border: #dee2e6;
}

.ihm-application-form {
    max-width: 1000px;
    margin: 0 auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Hero Section */
.ihm-hero {
    background: linear-gradient(135deg, var(--ihm-primary) 0%, #2a4a73 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 8px;
}

.ihm-hero h2 {
    color: white;
    font-size: 36px;
    margin-bottom: 10px;
}

.ihm-hero .batch-year {
    color: var(--ihm-secondary);
    font-size: 20px;
    margin-bottom: 10px;
}

.ihm-hero .note {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

/* Form Section */
.ihm-form-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    overflow: hidden;
}

.ihm-form-section h3 {
    background: #f8f9fa;
    padding: 15px 20px;
    border-left: 4px solid var(--ihm-secondary);
    color: var(--ihm-primary);
    font-size: 18px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ihm-form-section h3 i {
    color: var(--ihm-secondary);
}

.ihm-form-section > .ihm-form-group,
.ihm-form-section > .ihm-form-row,
.ihm-form-section > .ihm-parent-section,
.ihm-form-section > .ihm-lang-table,
.ihm-form-section > .ihm-data-table,
.ihm-form-section > .ihm-upload-section,
.ihm-form-section > .ihm-reference-section,
.ihm-form-section > .ihm-declaration-box,
.ihm-form-section > .ihm-conditional-section,
.ihm-form-section > .ihm-section-note,
.ihm-form-section > .ihm-checkbox-group {
    padding: 20px;
}

/* Form Groups */
.ihm-form-group {
    margin-bottom: 20px;
}

.ihm-form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--ihm-primary);
    font-weight: 500;
    font-size: 14px;
}

.ihm-form-group input[type="text"],
.ihm-form-group input[type="email"],
.ihm-form-group input[type="tel"],
.ihm-form-group input[type="date"],
.ihm-form-group input[type="number"],
.ihm-form-group input[type="month"],
.ihm-form-group select,
.ihm-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--ihm-border);
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.ihm-form-group input:focus,
.ihm-form-group select:focus,
.ihm-form-group textarea:focus {
    outline: none;
    border-color: var(--ihm-secondary);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1);
}

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

/* Form Rows */
.ihm-form-row {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.ihm-form-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.ihm-form-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.ihm-form-row-4 {
    grid-template-columns: 100px repeat(3, 1fr);
}

.ihm-form-group-small {
    max-width: 120px;
}

.ihm-form-group-half {
    max-width: 50%;
}

/* Checkbox Group */
.ihm-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.ihm-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.ihm-checkbox-group label {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Upload Section */
.ihm-upload-section {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.ihm-upload-box {
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.ihm-upload-box label {
    display: block;
    margin-bottom: 10px;
    color: var(--ihm-primary);
    font-weight: 500;
}

.ihm-upload-preview {
    width: 150px;
    height: 180px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    overflow: hidden;
    background: #f9f9f9;
}

.ihm-upload-preview.has-image {
    border-style: solid;
    border-color: var(--ihm-secondary);
}

.ihm-upload-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ihm-upload-preview i {
    font-size: 40px;
    color: #ccc;
}

.ihm-upload-preview p {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.ihm-upload-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.ihm-upload-info {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

/* Parent Section */
.ihm-parent-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ihm-parent-section h4 {
    color: var(--ihm-primary);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ihm-secondary);
}

/* Sibling Entry */
.ihm-sibling-entry {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #eee;
}

/* Language Table */
.ihm-lang-table {
    width: 100%;
    border-collapse: collapse;
}

.ihm-lang-table th,
.ihm-lang-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid var(--ihm-border);
}

.ihm-lang-table th {
    background: #f8f9fa;
    color: var(--ihm-primary);
    font-weight: 600;
}

.ihm-lang-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.ihm-custom-lang-input {
    margin-top: 8px;
}

.ihm-custom-lang-input input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--ihm-border);
    border-radius: 4px;
}

/* Data Table */
.ihm-data-table {
    width: 100%;
    border-collapse: collapse;
}

.ihm-data-table th,
.ihm-data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--ihm-border);
}

.ihm-data-table th {
    background: #f8f9fa;
    color: var(--ihm-primary);
    font-weight: 600;
    font-size: 13px;
}

.ihm-data-table input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--ihm-border);
    border-radius: 4px;
}

/* Conditional Section */
.ihm-conditional-section {
    display: none;
}

/* Reference Section */
.ihm-reference-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.ihm-reference-section h4 {
    color: var(--ihm-primary);
    margin-bottom: 15px;
}

/* Declaration Box */
.ihm-declaration-box {
    background: #fffdf5;
    border: 1px solid var(--ihm-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.ihm-declaration-box p {
    color: #555;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 10px;
}

/* Section Note */
.ihm-section-note {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

/* Info Box */
.ihm-info-box {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.ihm-info-box h4 {
    color: #004085;
    margin-bottom: 10px;
}

.ihm-info-box p {
    color: #004085;
}

/* Buttons */
.ihm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ihm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.ihm-btn-primary:hover {
    background: #152a45;
}

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

.ihm-btn-secondary:hover {
    background: #b08d1f;
}

.ihm-btn-outline {
    background: transparent;
    border: 1px solid var(--ihm-primary);
    color: var(--ihm-primary);
}

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

/* Form Navigation */
.ihm-form-navigation {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    border-top: 1px solid var(--ihm-border);
}

/* Preview Modal */
.ihm-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    overflow-y: auto;
    align-items: flex-start;
    justify-content: center;
    padding: 50px 20px;
}

.ihm-preview-modal.active {
    display: flex;
}

.ihm-preview-content {
    background: white;
    border-radius: 10px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.ihm-preview-header {
    background: var(--ihm-primary);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ihm-preview-header h2 {
    color: white;
    margin: 0;
}

.ihm-preview-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

.ihm-preview-body {
    padding: 30px;
}

.ihm-preview-footer {
    padding: 20px;
    background: #f5f5f5;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .ihm-form-row-2,
    .ihm-form-row-3,
    .ihm-form-row-4 {
        grid-template-columns: 1fr;
    }
    
    .ihm-form-group-small,
    .ihm-form-group-half {
        max-width: 100%;
    }
    
    .ihm-upload-section {
        flex-direction: column;
    }
    
    .ihm-form-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .ihm-form-navigation .ihm-btn {
        width: 100%;
        justify-content: center;
    }
}
