/* Form Group - Enhanced Clarity and Spacing */
.form-group {
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
}

/* Form Label - Improved Readability */
.form-group label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color, #2d3748);
    letter-spacing: 0.4px;
    line-height: 1.5;
}

/* Form Control - Modernized Input Fields */
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-color, #2d3748);
    background: var(--input-bg, #f7fafc);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #4f46e5);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
    background: #fff;
}

.form-control[readonly] {
    background: var(--input-readonly-bg, #edf2f7);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-control[type="file"] {
    padding: 12px;
    background: var(--card-bg, #fff);
    border: 2px dashed var(--border-color, #e2e8f0);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.form-control[type="file"]:hover {
    border-color: var(--primary-color, #4f46e5);
    color: 229;
    background: var(--input-hover-bg, #f0f5ff);
}

.template-select {
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%236b7280' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3e%3C/svg%3e") no-repeat;
    background-position: right 12px;
    center: 12px;
    background-size: 18px;
    padding-right: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-select:focus {
    border-color: var(--primary-color, #4f46e5);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
    background-color: #fff;
}

/* Styling for Section Headers */
.form-section-header {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-left: 6px solid transparent;
    position: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-section-header:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Individual Section Colors */
.form-section-header:nth-child(1) {
    border-left-color: #4f46e5;
    background: linear-gradient(to right, #f9fafb 0%, #ffffff 20%);
}

.form-section-header:nth-child(2) {
    border-left-color: #10b981;
    background: linear-gradient(to right, #f0 20%, #ffffff 20%);
}

.form-section-header:nth-child(3) {
    border-left-color: #f59e0b;
    background: linear-gradient(to right, #fffbeb 0%, #ffffff 20%);
}

.form-section-header:nth-child(4) {
    border-left-color: #8b5cf6;
    background: linear-gradient(to right, #f5f3ff 0%, #ffffff 20%);
}

/* Section Header Titles */
.form-section-header h3 {
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color, #2d3748);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    letter-spacing: 0.3px;
}

/* Icons for Section Headers */
.form-section-header h3::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 28px;
    margin-right: 12px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.form-section-header:nth-child(1) h3::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%234e73ff' viewBox='0 0 24 24'%3E%3Cpath d='M19 3H5a2 2 0 0 1-2 2v14a2 2 0 0 1 2 2h14a2 2 0 0 1 2-2V5a2 2 0 0 1-2-2zM8 9h8v2H8V9zm0 4h8v2H8v-2z'/%3E%3C/svg%3E");
}

.form-section-header:nth-child(2) h3::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2310b981' viewBox='0 0 24 24'%3E%3Cpath d='M9 12h6m-6 4h6m2 5H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5.586a1 1 0 0 1 .707.293l5.414 5.414a1 1 0 0 1 .293.707V19a2 2 0 0 1-2 2z'/%3E%3C/svg%3E");
}

.form-section-header:nth-child(3) h3::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23f59e0b' viewBox='0 0 24 24'%3E%3Cpath d='M9 17l-4-4m0 0l4-4m-4 4h14m0 0a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2h14z'/%3E%3C/svg%3E");
}

.form-section-header:nth-child(4) h3::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%238b5cf6' viewBox='0 0 24 24'%3E%3Cpath d='M3 10h18M7 15h1m4 0h1m4 0h1M5 5h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z'/%3E%3C/svg%3E");
}

/* Form Groups within Sections */
.form-section-header .form-group {
    margin-bottom: 18px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.form-section-header .form-group:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
}

.form-section-header .form-group:last-child {
    margin-bottom: 0;
}

.form-section-header {
    animation: fadeIn 0.5s ease forwards;
}

.form-section-header:nth-child(1) { animation-delay: 0.1s; }
.form-section-header:nth-child(2) { animation-delay: 0.2s; }
.form-section-header:nth-child(3) { animation-delay: 0.3s; }
.form-section-header:nth-child(4) { animation-delay: 0.4s; }

/* Textarea Specific Styling */
textarea.form-control {
    min-height: 120px;
    max-height: 280px;
    resize: vertical;
    line-height: 1.6;
    border-radius: 10px;
}

/* Submit Button - Enhanced Design */
.btn-submit {
    background: linear-gradient(135deg, var(--primary-color, #4f46e5) 0%, var(--primary-dark, #4338ca) 100%);
    color: white;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

.btn-submit:hover {
    background: linear-gradient(135deg, var(--primary-dark, #4338ca) 0%, var(--primary-color, #4f46e5) 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-submit:disabled {
    background: var(--disabled-bg, #d1d5db);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.btn-submit.loading {
    color: transparent;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    border: 3px solid var(--card-bg, #ffffff);
    border-top: 3px solid var(--primary-color, #4f46e5);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-submit.success {
    background: var(--success-color, #10b981);
}

.btn-submit.success::before {
    content: '\2713';
    font-size: 24px;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: checkmarkAppear 0.4s ease forwards;
}

/* Enhanced Tab Styling */
.avn-tabs {
    margin-top: 18px;
    background: var(--card-bg, #ffffff);
    border-radius: 14px;
    padding: 7px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.avn-tab-header {
    display: flex;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color, #e5e7eb);
    background: linear-gradient(to right, #f9fafb 0%, #ffffff 20%);
    border-radius: 10px 10px 0 0;
}

.avn-tab {
    flex: 1;
    padding: 14px 18px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-light, #6b7280);
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: var(--input-bg, #f7fafc);
}

.avn-tab:hover {
    color: var(--primary-color, #4f46e5);
    background: var(--input-hover-bg, #f0f5ff);
}

.avn-tab.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color, #4f46e5) 0%, var(--primary-dark, #4338ca) 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.avn-tab-content {
    padding: 18px;
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.avn-tab-pane {
    display: none;
}

.avn-tab-pane.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

#remarks-tab.active {
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color, #4f46e5) var(--card-bg, #ffffff);
}

#remarks-tab.active::-webkit-scrollbar {
    width: 8px;
}

#remarks-tab.active::-webkit-scrollbar-track {
    background: var(--card-bg, #ffffff);
    border-radius: 4px;
}

#remarks-tab.active::-webkit-scrollbar-thumb {
    background: var(--primary-color, #4f46e5);
    border-radius: 4px;
}

#remarks-tab.active::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark, #4338ca);
}

/* Animation Keyframes */
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes checkmarkAppear {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.reports-filter {
    padding: 12px;
    background: white;
    margin-bottom: 12px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.filter-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Increased gap for better spacing between button and input */
    padding: 12px; /* Consistent padding */
    background: #f0f4ff;
    border-radius: 8px; /* Smooth corners */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04); /* Subtle shadow */
    margin: 12px 0; /* Balanced margins */
}

.search-container #avn-search-input {
    width: 100%; /* Full width of the page-header */
    padding: 12px 16px; /* Comfortable padding */
    border: 1px solid var(--border-color, #d1d5db); /* Softer gray border */
    border-radius: 10px; /* Smooth, modern rounded corners */
    font-size: 15px; /* Readable font size */
    font-weight: 400; /* Lighter weight for elegance */
    color: #111827; /* Dark text for contrast */
    background: #f8fafc; /* Subtle off-white background */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); /* Very subtle shadow */
    transition: all 0.3s ease; /* Smooth transitions for border, shadow, and transform */
}

.search-container #avn-search-input:focus {
    outline: none;
    border-color: #3b82f6; /* Bright blue focus border */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); /* Subtle focus ring */
    transform: translateY(-1px); /* Slight lift on focus */
}

.search-container #avn-search-input::placeholder {
    color: #9ca3af; /* Softer placeholder color */
    font-weight: 400;
}

.search-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
}

.search-button {
    background-color: var(--primary-color, #4f46e5);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    margin-top: 12px;
    width: 100%;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background-color: var(--primary-dark, #4338ca);
    transform: translateY(-2px);
}

.search-result {
    position: relative;
    margin-bottom: 18px;
}

.close-result {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 16px;
}

.close-result:hover {
    color: #4b5563;
}

.expand-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 28px;
    margin: 10px auto;
    background: linear-gradient(135deg, var(--primary-color, #4f46e5) 0%, var(--primary-dark, #4338ca) 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.expand-button:hover {
    background: linear-gradient(135deg, var(--primary-dark, #4338ca) 0%, var(--primary-color, #4f46e5) 100%);
    transform: scale(0.98);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.expand-button:active {
    transform: scale(0.82);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.expand-button.collapse-button {
    background: linear-gradient(135deg, var(--overdue-color, #ef4444) 0%, #dc2626 100%);
}

.expand-button.collapse-button:hover {
    background: linear-gradient(135deg, #dc2626 0%, var(--overdue-color, #ef4444) 100%);
}