/* ===================================
   CSC Online Recruitment System
   Custom Stylesheet
   =================================== */

/* ===================================
   Global Styles & Variables
   =================================== */
   
:root {
    --primary-color: #0077b6;
    --primary-dark: #005a8f;
    --primary-light: #0096c7;
    --secondary-color: #023e8a;
    --accent-color: #48cae4;
    --text-dark: #1a1a1a;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --transition-base: all 0.3s ease;
    --border-radius: 8px;
    --border-radius-lg: 12px;

    /* Spacing scale — consistent vertical rhythm */
    --space-xs:  0.5rem;   /*  8px */
    --space-sm:  1rem;     /* 16px */
    --space-md:  1.5rem;   /* 24px */
    --space-lg:  2.5rem;   /* 40px */
    --space-xl:  3.75rem;  /* 60px */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

a {
    text-decoration: none;
    transition: var(--transition-base);
}

img {
    max-width: 100%;
    height: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track  { background: var(--bg-light); }
::-webkit-scrollbar-thumb  { background: var(--primary-color); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* ===================================
   Top Bar
   =================================== */
.top-bar {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 8px 0;
    font-size: 0.85rem;
}

/* Keep the left side aligned to the start */
.top-bar-left {
    display: flex;
    align-items: center;
}

/* Push the right side to the end of the row */
.top-bar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* This is the magic line */
}

.top-bar a { color: var(--white); transition: var(--transition-base); }
.top-bar a:hover { color: var(--accent-color); transform: translateY(-1px); }

@media (max-width: 767px) {
    .top-bar { font-size: 0.75rem; text-align: center; }
    .top-bar-left, .top-bar-right { justify-content: center; flex-wrap: wrap; }
    .top-bar-left span { margin: 4px 8px; }
}

/* ===================================
   Navigation Bar
   =================================== */
.navbar {
    padding: 12px 0;
    transition: var(--transition-base);
}

.navbar-brand { display: flex; align-items: center; gap: 14px; }

.logo-img { height: 35px; width: auto; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }

.brand-text strong {
    font-size: 1.05rem;
    color: var(--primary-color);
    font-weight: 700;
}

.brand-text small {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 400;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: 7px 15px !important;
    margin: 0 4px;
    border-radius: var(--border-radius);
    transition: var(--transition-base);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background-color: rgba(0, 119, 182, 0.1);
}

.nav-link i { font-size: 0.875rem; }

@media (max-width: 991px) {
    .navbar-collapse { margin-top: 12px; }
    .nav-link { margin: 3px 0; }
}

/* ===================================
   Hero Section
   =================================== */
.hero-section {
    position: relative;
    background: 
        linear-gradient(rgba(2, 62, 138, 0.85), rgba(2, 62, 138, 0.85)),
        url('/assets/images/cscro8bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 90px 0 72px;
    overflow: hidden;
    
    /* Adjusted Fullscreen Height Properties */
    /* width: 100%; */
    /* min-height: calc(100vh - 100px); */
    /* min-height: calc(100dvh - 100px);  */
    
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,117.3C1248,117,1344,139,1392,149.3L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--white);
}

.hero-title {
    font-size: 3.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    color: var(--white);
}

.hero-subtitle {
    font-size: 1.15rem;
    font-weight: 300;
    margin-bottom: 1.75rem;
    opacity: 0.95;
}

.hero-buttons { margin-bottom: 2.25rem; }

.hero-buttons .btn {
    padding: 11px 28px;
    font-weight: 600;
    border-radius: var(--border-radius-lg);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-base);
}

.btn-primary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--white);
}

.btn-primary:hover {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

.btn-outline-light {
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

.hero-stats { display: flex; gap: 24px; flex-wrap: wrap; }

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.stat-item i { font-size: 1.4rem; color: var(--accent-color); }

.hero-illustration {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 380px;
}

.hero-logo-img {
    position: relative;
    z-index: 1;
    width: 320px;
    height: 320px;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-18px); }
}

.animate-fade-in        { animation: fadeIn 0.8s ease-out; }
.animate-fade-in-delay  { animation: fadeIn 0.8s ease-out 0.2s backwards; }
.animate-fade-in-delay-2{ animation: fadeIn 0.8s ease-out 0.4s backwards; }
.animate-fade-in-delay-3{ animation: fadeIn 0.8s ease-out 0.6s backwards; }
.animate-float          { animation: float 4s ease-in-out infinite; }

@media (max-width: 991px) {
    .hero-title    { font-size: 2.25rem; }
    .hero-subtitle { font-size: 1rem; }
    .hero-section  { padding: 56px 0 40px; min-height: auto; }
    .hero-buttons .btn { font-size: 0.875rem; padding: 9px 22px; }
}

@media (max-width: 575px) {
    .hero-title { font-size: 1.875rem; }
    .hero-buttons { display: flex; flex-direction: column; gap: 10px; }
    .hero-buttons .btn { width: 100%; margin: 0 !important; }
    .hero-stats { flex-direction: column; gap: 12px; }
}

/* ===================================
   Section Headers
   =================================== */
.section-header {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-light);
    font-weight: 400;
    margin-bottom: 0;
}

.title-divider {
    width: 72px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    margin: 14px auto 0;
    border-radius: 2px;
}

@media (max-width: 767px) {
    .section-title    { font-size: 1.875rem; }
    .section-subtitle { font-size: 0.95rem; }
}

/* ===================================
   Vacancies Section
   =================================== */
.vacancies-section {
    background: var(--bg-light);
}

/* Override Bootstrap table-hover/striped blue bleed */
#vacanciesTable.table-hover > tbody > tr:hover > * {
    --bs-table-color-state: var(--text-dark);
    --bs-table-bg-state: rgba(0, 119, 182, 0.05);
}

#vacanciesTable.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-color-type: var(--text-dark);
    --bs-table-bg-type: rgba(0, 0, 0, 0.025);
}

.table-card {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)) !important;
    padding: 14px 20px;
}

.card-header h5 { color: var(--white); margin: 0; font-weight: 600; }

.table { margin-bottom: 0; }

.table thead th {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    white-space: nowrap;
    padding: 13px 10px;
    font-size: 0.875rem;
}

.table tbody tr { transition: var(--transition-base); }
.table tbody tr:hover { background-color: rgba(0, 119, 182, 0.05); }

/* Remove blue outline/highlight on td focus and DataTables empty row hover */
.table tbody td:focus,
.table tbody td:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* DataTables empty message row — no hover color, no blue */
.table tbody tr.odd:hover,
.table tbody tr.even:hover,
#vacanciesTable tbody tr.odd:hover td,
#vacanciesTable tbody tr.even:hover td {
    background-color: rgba(0, 119, 182, 0.05) !important;
}

#vacanciesTable tbody td.dataTables_empty,
#vacanciesTable tbody tr:hover td.dataTables_empty {
    background-color: transparent !important;
    color: var(--text-light);
    text-align: center;
    padding: 2rem 1rem;
    border: none;
}

.table td {
    vertical-align: middle;
    padding: 11px 10px;
    font-size: 0.9rem;
}

.btn-apply {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 6px 18px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition-base);
    white-space: nowrap;
}

.btn-apply:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-view-details {
    background: var(--info-color);
    color: var(--white);
    border: none;
    padding: 5px 14px;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition-base);
    margin-right: 4px;
}

.btn-view-details:hover {
    background: #138496;
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.badge-new {
    background: var(--success-color);
    color: var(--white);
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 6px;
}

.badge-deadline {
    background: var(--danger-color);
    color: var(--white);
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ===================================
   How to Apply Section
   =================================== */
.step-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 28px 20px 24px;
    text-align: center;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.step-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background-color: var(--primary-color); /* Replaced gradient */
    transform: scaleX(0);
    transition: var(--transition-base);
}

.step-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.step-card:hover::before { transform: scaleX(1); }

.step-number {
    position: absolute;
    top: 14px; right: 14px;
    width: 36px; height: 36px;
    background-color: var(--primary-color); /* Replaced gradient */
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.step-icon {
    width: 72px; height: 72px;
    margin: 0 auto 16px;
    background-color: rgba(0, 119, 182, 0.1); /* Replaced gradient with a solid 10% opacity of --primary-color */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.step-icon i { font-size: 2.25rem; color: var(--primary-color); transition: var(--transition-base); }

.step-card:hover .step-icon { background-color: var(--primary-color); } /* Replaced gradient */
.step-card:hover .step-icon i { color: var(--white); }

.step-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.step-description {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0;
}

/* ===================================
   Contact Section
   =================================== */
.contact-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 36px 28px;
    text-align: center;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    height: 100%;
}

.contact-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.contact-icon {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    background-color: var(--primary-color); /* Replaced gradient */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.contact-icon i { font-size: 1.75rem; color: var(--white); }
.contact-card:hover .contact-icon { transform: scale(1.1) rotate(5deg); }

.contact-card h5 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.contact-card p { font-size: 0.9rem; color: var(--text-light); line-height: 1.8; margin: 0; }

/* ===================================
   Footer
   =================================== */
.footer {
    background: linear-gradient(135deg, #023e8a 0%, #001d3d 100%);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--space-xl) 0 0;
    margin-top: 0;
}

.footer-logo { height: 56px; width: auto; }

.footer h5 {
    color: var(--white);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 10px;
}

.footer h5::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 36px; height: 2px;
    background: var(--accent-color);
}

.footer p { font-size: 0.875rem; line-height: 1.75; }

.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    transition: var(--transition-base);
    display: inline-block;
}

.footer-links a:hover { color: var(--accent-color); transform: translateX(4px); }

.social-links { display: flex; gap: 12px; }

.social-link {
    width: 42px; height: 42px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.1rem;
    transition: var(--transition-base);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
    background: var(--accent-color);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(72, 202, 228, 0.4);
}

.seal-img { width: 90px; height: auto; opacity: 0.8; transition: var(--transition-base); }
.seal-img:hover { opacity: 1; }

.footer-bottom {
    margin-top: var(--space-lg);
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

/* ===================================
   Back to Top Button
   =================================== */
.back-to-top {
    position: fixed;
    bottom: 28px; right: 28px;
    width: 46px; height: 46px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: var(--shadow-md);
    z-index: 999;
}

.back-to-top:hover { background: var(--primary-dark); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.back-to-top.show  { display: flex; }

/* ===================================
   SweetAlert2 Customization
   =================================== */
.swal2-popup { font-family: 'Poppins', sans-serif; border-radius: var(--border-radius-lg); }
.swal2-title { color: var(--primary-color); font-weight: 600; }
.swal2-confirm { background: var(--primary-color) !important; border-radius: var(--border-radius); }
.swal2-confirm:hover { background: var(--primary-dark) !important; }
.swal2-cancel { border-radius: var(--border-radius); }

/* ===================================
   Utility Classes
   =================================== */
.text-primary-custom  { color: var(--primary-color) !important; }
.bg-primary-custom    { background: var(--primary-color) !important; }
.shadow-custom        { box-shadow: var(--shadow-lg); }
.border-radius-custom { border-radius: var(--border-radius-lg); }

/* ===================================
   Responsive Utilities
   =================================== */
@media (max-width: 991px) {
    .section-title { font-size: 1.875rem; }
    .footer { text-align: center; }
    .footer h5::after { left: 50%; transform: translateX(-50%); }
    .social-links { justify-content: center; }
}

@media (max-width: 575px) {
    .back-to-top { width: 42px; height: 42px; bottom: 18px; right: 18px; }
    .step-card { margin-bottom: 16px; }
}

/* ===================================
   Loading States
   =================================== */
.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show { display: flex; }

.spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--bg-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===================================
   Print Styles
   =================================== */
@media print {
    .top-bar,
    .navbar,
    .hero-section,
    .how-to-apply-section,
    .contact-section,
    .footer,
    .back-to-top { display: none; }

    .vacancies-section { margin-top: 0; }
}