/* ============================================================ */
/* TASK FORM ENHANCED UX STYLES                               */
/* ============================================================ */

/* Tab Navigation */
.tab-button,
.modal-tab-btn {
    position: relative;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.tab-button:hover,
.modal-tab-btn:hover {
    color: #0f172a;
    border-bottom-color: #93c5fd;
}

.tab-button.active,
.modal-tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Sections */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Field Icons */
.field-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.25rem;
    width: 1.25rem;
    border-radius: 9999px;
    margin-right: 0.5rem;
}

/* Field Hints */
.field-hint {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.field-hint i {
    margin-right: 0.25rem;
}

/* Form Inputs Enhancement */
input[type="text"],
input[type="email"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Select2 Styling */
.select2-container--default .select2-selection--single {
    border-color: #e2e8f0;
    transition: all 0.2s ease;
}

.select2-container--default .select2-selection--single:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #3b82f6;
}

/* Photo Form Cards */
.photo-form {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background-color: rgba(248, 250, 252, 0.5);
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.photo-form:hover {
    border-color: #93c5fd;
    background-color: rgba(239, 246, 255, 0.3);
}

.photo-form.has-error {
    border-color: #fca5a5;
    background-color: rgba(254, 226, 226, 0.3);
}

/* Info Boxes */
.info-box {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid;
}

.info-box.blue {
    border-color: #bfdbfe;
    background-color: rgba(239, 246, 255, 0.5);
    color: #1e40af;
}

.info-box.blue i {
    color: #2563eb;
}

.info-box.green {
    border-color: #bbf7d0;
    background-color: rgba(240, 253, 244, 0.5);
    color: #166534;
}

.info-box.green i {
    color: #16a34a;
}

.info-box.amber {
    border-color: #fcd34d;
    background-color: rgba(254, 252, 232, 0.5);
    color: #92400e;
}

.info-box.amber i {
    color: #ca8a04;
}

.info-box.red {
    border-color: #fecaca;
    background-color: rgba(254, 242, 242, 0.5);
    color: #991b1b;
}

.info-box.red i {
    color: #dc2626;
}

/* Button Styles */
button[type="submit"],
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    background-color: #2563eb;
    color: white;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

button[type="submit"]:hover,
.btn-primary:hover {
    background-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

button[type="submit"]:focus,
.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Table Styling */
table {
    width: 100%;
}

table thead tr {
    border-bottom: 1px solid #cbd5e1;
}

table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

table th {
    text-align: left;
    font-weight: 600;
    color: #1e293b;
    padding: 0.5rem;
}

table td {
    padding: 0.5rem;
    color: #475569;
}

/* Error States */
.field-error,
.errorlist {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.errorlist {
    list-style: disc;
    padding-left: 1.25rem;
}

/* Loading Spinner */
.spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 9999px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .form-section {
        gap: 1rem;
    }

    .tab-button,
    .modal-tab-btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

    button[type="submit"],
    .btn-primary {
        width: 100%;
    }
}

/* Accessibility */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .tab-button,
    .modal-tab-btn {
        color: #94a3b8;
    }

    .tab-button:hover,
    .modal-tab-btn:hover {
        color: #f1f5f9;
    }

    input[type="text"],
    input[type="email"],
    input[type="date"],
    textarea,
    select {
        background-color: #1e293b;
        color: #f1f5f9;
        border-color: #334155;
    }

    input[type="text"]:focus,
    input[type="email"]:focus,
    input[type="date"]:focus,
    textarea:focus,
    select:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }
}

/* Print Styles */
@media print {
    .tab-button,
    .modal-tab-btn,
    button,
    .btn-primary {
        display: none;
    }

    .form-section {
        page-break-inside: avoid;
    }
}
