/* ==========================================================================
   COZM VISA - MODERN THEME OVERRIDES
   "Design System" Layer to enforce consistency and polish
   ========================================================================== */

:root {
    /* Re-enforcing Brand Palette */
    --brand-primary: #3FAEBD;
    --brand-primary-light: #C7E5E9;
    --brand-primary-dark: #2A8A96;

    --brand-secondary: #BD4040;
    --brand-secondary-light: #F0CFCF;
    --brand-secondary-dark: #9A3333;

    --brand-tertiary-purple: #AA40BD;
    --brand-tertiary-yellow: #BC993F;

    /* Modern UI Variables */
    --ui-radius-sm: 6px;
    --ui-radius-md: 10px;
    --ui-radius-lg: 16px;

    --ui-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --ui-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --ui-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --ui-shadow-hover: 0 8px 20px rgba(63, 174, 189, 0.2);

    --ui-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    --ui-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==================== GLOBAL RESET & TYPOGRAPHY ==================== */

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: var(--ui-font-sans);
    background-color: #f8fafc;
    /* Softer background than pure gray-100 */
    color: #1e293b;
    /* Softer black */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: -0.02em;
    /* Modern tight tracking for headings */
}

/* ==================== COMPONENT POLISH ==================== */

/* 1. Buttons - Modernized */
.btn {
    border-radius: var(--ui-radius-md);
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: var(--ui-transition);
    box-shadow: var(--ui-shadow-sm);
    text-transform: none;
    /* Remove generic casing if any */
    padding: 12px 24px;
}

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

.btn-primary:hover {
    background: var(--brand-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--ui-shadow-hover);
}

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

.btn-secondary {
    background: #ffffff;
    color: var(--brand-primary-dark);
    border: 1px solid #e2e8f0;
    /* Slate-200 */
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    transform: translateY(-1px);
}

/* 2. Inputs & Forms - Standardized */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
select,
textarea {
    border: 1px solid #cbd5e1;
    /* Slate-300 */
    border-radius: var(--ui-radius-sm);
    padding: 12px 16px;
    font-size: 15px;
    transition: var(--ui-transition);
    background-color: #fff;
    box-shadow: var(--ui-shadow-sm);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 174, 189, 0.15);
    /* Soft glow */
}

label {
    font-weight: 600;
    color: #334155;
    /* Slate-700 */
    font-size: 14px;
    margin-bottom: 6px;
}

/* 3. Cards & Containers - Clean & Floating */
.card,
.stat-card,
.login-card,
.info-box,
.assessment-card,
.summary-section,
.next-steps-container,
.vfs-instructions-container,
.govuk-completion-message {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    /* Subtle border */
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-md);
}

/* Special overrides for specific cards */
.login-card {
    border: none;
    /* Login usually looks better clean */
}

.info-box {
    background: #f0f9fa;
    /* Brand light tint */
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--ui-radius-md);
}

/* 4. Sidebar - Refined */
.sidebar {
    background: #000000;
    /* Pure black */
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
}

/* Modern menu item cards with subtle shadow on hover */
.menu-item a:hover,
.menu-item button.menu-parent:hover {
    box-shadow: 0 2px 8px rgba(63, 174, 189, 0.1);
}

/* Clean active state with left accent border */
.menu-item.active>a,
.menu-item.active>button.menu-parent {
    box-shadow: 0 2px 12px rgba(63, 174, 189, 0.15);
}

/* Submenu active state enhancement */
.submenu li a.active {
    box-shadow: 0 1px 4px rgba(63, 174, 189, 0.1);
}

/* 5. Progress & Steps */
.progress-container {
    border-radius: var(--ui-radius-lg);
    border: none;
    box-shadow: var(--ui-shadow-md);
}

.step-number {
    transition: var(--ui-transition);
}

.step.active .step-number {
    background: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(63, 174, 189, 0.2);
}

/* 6. Status Badges & Chips */
.status-badge,
.status-chip {
    border-radius: 100px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 6px 14px;
}

.status-pending {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}

.status-approved {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #dcfce7;
}

/* 7. Appendix 4 Dashboard Polish */
.appendix4-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e2e8f0;
}

.metric-card {
    border: none;
    box-shadow: var(--ui-shadow-lg);
}

.metric-card-teal {
    background: linear-gradient(145deg, var(--brand-primary), var(--brand-primary-dark));
}

/* 8. Form Group Spacing */
.form-group {
    margin-bottom: 24px;
    /* More breathing room */
}

/* 9. Tables */
.applications-table thead {
    background: #f8fafc;
}

.applications-table th {
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.applications-table td {
    border-bottom: 1px solid #f1f5f9;
}

/* 10. Animations & Transitions */
.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 11. Modal Overrides & Unification */
.modal-content {
    background: #ffffff !important;
    border-radius: var(--ui-radius-lg) !important;
    box-shadow: var(--ui-shadow-lg) !important;
    border: none !important;
    padding: 32px !important;
    font-family: var(--ui-font-sans);
}

.modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.modal-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
    margin-top: 24px;
    background: transparent !important;
}

/* Fix inline styled buttons in modals */
.modal-content button[style*="background: white"],
.modal-content button[style*="background-color: #fff"] {
    border: 1px solid #cbd5e1 !important;
    border-radius: var(--ui-radius-sm) !important;
    padding: 10px 20px !important;
    color: #475569 !important;
    font-weight: 600 !important;
    transition: var(--ui-transition) !important;
}

.modal-content button[style*="background: white"]:hover {
    background: #f8fafc !important;
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}

/* Fix inline styled inputs in modals */
.modal-content input[style*="border"],
.modal-content input[style*="padding"] {
    border: 1px solid #cbd5e1 !important;
    border-radius: var(--ui-radius-sm) !important;
    padding: 12px 16px !important;
    box-shadow: var(--ui-shadow-sm) !important;
}

.modal-content input:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(63, 174, 189, 0.15) !important;
}

/* Notification Modal Specifics */
#notificationModal .modal-content {
    text-align: center;
}

.notification-modal-content {
    max-width: 420px !important;
    padding: 40px 32px !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
}

.notification-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(63, 174, 141, 0.1), rgba(63, 174, 141, 0.05));
    box-shadow: 0 4px 12px rgba(63, 174, 141, 0.15);
}

.notification-icon {
    font-size: 48px !important;
    line-height: 1;
    display: block;
}

.notification-title {
    color: #1e293b !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    margin: 0 0 12px 0 !important;
    letter-spacing: -0.02em;
}

.notification-message {
    color: #64748b !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    margin: 0 0 32px 0 !important;
}

.notification-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.notification-btn {
    padding: 12px 32px !important;
    border: none !important;
    background: linear-gradient(135deg, var(--brand-primary), #359d7e) !important;
    color: white !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(63, 174, 141, 0.25) !important;
    min-width: 120px;
}

.notification-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(63, 174, 141, 0.35) !important;
}

.notification-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(63, 174, 141, 0.25) !important;
}

/* Icon wrapper color variations based on notification type */
#notificationModal.success-notification .notification-icon-wrapper {
    background: linear-gradient(135deg, rgba(63, 174, 141, 0.15), rgba(63, 174, 141, 0.08));
}

#notificationModal.error-notification .notification-icon-wrapper {
    background: linear-gradient(135deg, rgba(189, 64, 64, 0.15), rgba(189, 64, 64, 0.08));
}

#notificationModal.warning-notification .notification-icon-wrapper {
    background: linear-gradient(135deg, rgba(188, 150, 63, 0.15), rgba(188, 150, 63, 0.08));
}

#notificationModal.info-notification .notification-icon-wrapper {
    background: linear-gradient(135deg, rgba(37, 117, 252, 0.15), rgba(37, 117, 252, 0.08));
}

/* Country Detail Modal Special Layout */
#countryDetailModal .modal-content {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
}

#countryDetailModal .modal-header {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-tertiary-purple)) !important;
    /* Brand colors instead of random purple */
    color: white;
    padding: 24px 30px !important;
    margin: 0 !important;
    border-radius: var(--ui-radius-lg) var(--ui-radius-lg) 0 0;
}

#countryDetailModal .modal-body {
    padding: 30px;
    overflow-y: auto;
}

#countryDetailModal .modal-footer {
    background: #f9fafb !important;
    padding: 20px 30px !important;
    margin: 0 !important;
}

#closeCountryDetailBtn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#closeCountryDetailBtn:hover {
    background: rgba(255, 255, 255, 0.4);
}