/* refined style.css for Premium UX/UI */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Open+Sans:wght@400;600&display=swap');

:root {
    /* Brand Colors */
    --primary-navy: #023a5b;
    --primary-cyan: #023a5b;
    --cyan-hover: #035686;
    --secondary-blue: #035686;
    --accent-gray: #f4f6f9;

    /* Functional Colors */
    --text-main: #1a202c;
    --text-muted: #718096;
    --text-light: #ffffff;
    --success: #2ecc71;
    --warning: #f1c40f;
    --danger: #e74c3c;
    --border: #e2e8f0;

    /* Shadows & Effects */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --gradient-brand: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-blue) 100%);
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--accent-gray);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-navy);
    font-weight: 700;
    margin-top: 0;
}

/* Header */
header {
    background: var(--gradient-brand);
    color: var(--text-light);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    /* Glassmorphism hint if supported */
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

header h1 a {
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

header h1::before {
    display: none;
}

header nav {
    display: flex;
    gap: 10px;
}

header nav a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
}

header nav a:hover {
    color: white;
}

header nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: white;
    transition: width 0.3s ease;
}

header nav a:hover::after {
    width: 100%;
}

/* Nav CTA Button Fix */
header nav a.nav-cta {
    padding: 0.5rem 1.2rem;
    margin-left: 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-navy) !important;
    /* Force text color for button */
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

header nav a.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: #f1f5f9;
    color: var(--primary-navy);
}

/* Remove underline from CTA button */
header nav a.nav-cta::after {
    display: none !important;
    content: none;
}

/* Main Container */
.container {
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    animation: fadeIn 0.5s ease-out;
}

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

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

/* Cards */
.card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid white;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 2rem;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.card h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-navy);
    border-radius: 2px;
}

/* Modern Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
    /* Removed text-transform: uppercase for clearer readability */
}

input:not([type="radio"]):not([type="checkbox"]),
select,
textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #cbd5e1;
    /* Softer border */
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

input[type="radio"],
input[type="checkbox"] {
    width: auto;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

input:not([type="radio"]):not([type="checkbox"]):hover,
select:hover {
    border-color: #94a3b8;
}

input:not([type="radio"]):not([type="checkbox"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-navy);
    box-shadow: 0 0 0 3px rgba(2, 58, 91, 0.15);
    background-color: #ffffff;
}

input[type="radio"]:focus,
input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 58, 91, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

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

.btn-primary:hover {
    background: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(2, 58, 91, 0.3);
}

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

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Table Design */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1.5rem;
}

th {
    background: var(--accent-gray);
    color: var(--secondary-blue);
    padding: 1.2rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.95rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f7fafc;
}

/* Status Badges */
.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-pending_head {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.status-pending_management {
    background: #e7f9ff;
    color: #0c5460;
    border: 1px solid #b8daff;
}

.status-approved {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Login Page Specifics */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #035686 0%, #023a5b 100%);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    /* Abstract shape */
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(5, 243, 255, 0.05);
    /* Cyan tint */
    border-radius: 50%;
    top: -200px;
    right: -200px;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    padding: 3.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-brand {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-brand h1 {
    color: var(--primary-navy);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Demo Credentials Box */
.demo-creds {
    margin-top: 2rem;
    background: var(--accent-gray);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px dashed var(--border);
}

/* Tabbed Interface Styles */
.tab-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 2rem;
}

.tab-header {
    display: flex;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 1.2rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(5, 243, 255, 0.05);
    color: var(--primary-navy);
}

.tab-btn.active {
    background: white;
    color: var(--primary-navy);
    border-bottom-color: var(--primary-navy);
}

/* IMPORTANT: Ensure white background is explicitly set */
.tab-content {
    background: white !important;
    padding: 2.5rem;
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

/* Enhancing inputs within tabs */
.tab-content .form-group label {
    color: var(--primary-navy);
}

.tab-icon {
    font-size: 1.2rem;
}

/* Improved Form Section Headers */
.form-section-title {
    font-size: 0.9rem;
    color: var(--primary-navy);
    /* Darker, more professional color */
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.8rem;
    margin: 2rem 0 1.5rem 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-section-title i {
    color: var(--primary-navy);
    /* Icon keeps the brand accent */
    background: rgba(2, 58, 91, 0.1);
    padding: 8px;
    border-radius: 6px;
    font-size: 1rem;
}

/* Input with Icons */
.input-icon-wrapper {
    position: relative;
    width: 100%;
}

.input-icon-wrapper i.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    z-index: 10;
    font-size: 1rem;
    transition: color 0.2s;
}

.input-icon-wrapper input,
.input-icon-wrapper select {
    padding-left: 3rem !important;
    /* Space for the icon */
}

.input-icon-wrapper input:focus+i,
.input-icon-wrapper input:focus~i {
    color: var(--primary-navy);
}

/* Floating Label effect (Simulated via focus) */
.form-group label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 600;
    margin-left: 2px;
}

/* Refined Submit Button Section */
.submit-section {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Group buttons to the right */
    gap: 20px;
    /* Space between Cancel and Submit */
    border-radius: 0 0 12px 12px;
}

/* Refined Submit Button */
.btn-submit-request {
    background: var(--primary-navy);
    color: white;
    font-size: 1.1rem;
    padding: 1rem 3rem;
    border-radius: 50px;
    box-shadow: 0 10px 20px rgba(2, 58, 91, 0.2);
    border: none;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-submit-request:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(5, 243, 255, 0.3);
}

.form-section-title:first-child {
    margin-top: 0;
}

/* Responsive Grid System */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

/* Fix for Select2 Text Overlap with Icons */
.input-icon-wrapper .select2-selection__rendered {
    padding-left: 30px !important;
}

/* STRONG Fix for Select2 Icon Overlap & Height Matching */
.input-icon-wrapper .select2-container .select2-selection--single {
    height: 42px !important;
    padding-left: 45px !important;
    /* Increased space for icon */
    display: flex !important;
    align-items: center !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background-color: #ffffff;
    /* Ensure white background */
}

.input-icon-wrapper .select2-selection__rendered {
    padding-left: 0 !important;
    line-height: normal !important;
    color: var(--text-main) !important;
}

.input-icon-wrapper .select2-selection__arrow {
    height: 40px !important;
    top: 1px !important;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
        width: 100% !important;
        margin: 0;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }

    nav {
        width: 100%;
        justify-content: center;
        gap: 15px;
        /* Add spacing between links */
    }

    .tab-header {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        /* Scrollbar space */
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll on iOS */
    }

    .tab-btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
        flex: 0 0 auto;
        /* Allow buttons to scroll */
    }

    /* Force Grids to Single Column */
    .form-grid-2,
    .form-grid-3,
    .tab-content div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .card,
    .tab-content {
        padding: 1.2rem;
        /* Comfortable mobile padding */
        background: white !important;
        /* Force white background on mobile too */
    }

    .submit-section {
        flex-direction: column-reverse;
        /* Button on top, cancel below */
        gap: 1rem;
        text-align: center;
        padding: 1.2rem;
        background: #fafafa;
        /* Keep consistent slightly off-white for footer */
    }

    .btn-submit-request {
        width: 100%;
        justify-content: center;
    }

    /* Login Page Mobile */
    .login-card {
        padding: 2rem;
        margin: 1rem;
    }
}