/* ============================================================
   layout.css  –  Global styles for TechWin PublicPortal
   Loaded on every page via _Layout.cshtml
   ============================================================ */

/* ?? CSS custom properties ?? */
:root {
    --primary-color:    #828486;
    --primary-light:    #d87d2a;
    --primary-dark:     #403d3c;
    --secondary-color:  #6c757d;
    --success-color:    #28a745;
    --info-color:       #17a2b8;
    --warning-color:    #ffc107;
    --danger-color:     #dc3545;
    --light-bg:         #f8f9fa;
    --white:            #ffffff;
    --text-dark:        #212529;
    --text-muted:       #6c757d;
    --border-color:     #dee2e6;
}

/* ?? Base ?? */
html {
    height: 100%;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f5f7fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    margin: 0;
    overflow-x: hidden;
    width: 100%;
}

/* ?? Navbar ?? */
.navbar-public {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    padding: 0;
    flex-shrink: 0;
    width: 100%;
}

.navbar-public .container {
    min-height: 64px;
    display: flex;
    align-items: center;
}

.navbar-brand {
    padding: 0;
    line-height: 1;
}

.navbar-brand img {
    max-height: 44px;
    width: auto;
}

.navbar-public .nav-link {
    color: #374151;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    transition: background 0.18s, color 0.18s;
}

.navbar-public .nav-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.navbar-public .nav-link.active {
    color: #1d4ed8;
    font-weight: 600;
    background: #eff6ff;
}

/* ?? Language selector ?? */
.language-selector {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem !important;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-color) !important;
    border-radius: 8px;
    transition: background 0.3s ease;
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
}

.language-selector:hover { background: var(--primary-color); }
.language-selector .fas { font-size: 1rem; }
.language-selector .lang-text { font-size: 0.9rem; font-weight: 600; }

.language-dropdown {
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 0.5rem;
    min-width: 180px;
}

.language-dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-dropdown .dropdown-item i {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
}

.language-dropdown .dropdown-item:hover {
    background: rgba(130,132,134,0.1);
    color: var(--primary-color);
}

.language-dropdown .dropdown-item.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.language-dropdown .dropdown-item.active i { color: white; }

/* ?? Layout wrappers ?? */
.main-wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: hidden;
}

.public-content {
    background: var(--white);
    border-radius: 1rem;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    padding: 2.5rem;
    margin: 2rem auto;
    max-width: 1400px;
    width: 100%;
}

/* ?? Hero section (Jobs pages) ?? */
.hero-section {
    color: var(--text-dark);
    padding: 2rem 3rem 0 3rem;
    margin: -2.5rem -2.5rem 1rem -2.5rem;
    border-radius: 1rem 1rem 0 0;
    text-align: left;
}

.hero-section h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.hero-section p  { font-size: 1.2rem; opacity: 0.95; margin-bottom: 0; }

/* ?? Job cards ?? */
.job-card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--white);
    height: 100%;
}

.job-card:hover {
    box-shadow: 0 12px 30px rgba(255,107,53,0.15);
    border-color: var(--primary-light);
}

.job-card-img       { height: 200px; object-fit: cover; width: 100%; }
.job-card-body      { padding: 1.5rem; }
.job-card-title     { color: var(--primary-color); font-weight: 600; font-size: 1.25rem; margin-bottom: 0.75rem; }
.job-description    { font-size: .8em; }
.job-badge {
    font-size: 0.80rem;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-weight: 500;
    border-style: solid;
    border-width: 1px;
}

/* ?? Buttons (portal defaults) ?? */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-outline-secondary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
}

/* ?? Forms ?? */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255,107,53,0.15);
}

.form-label { font-weight: 500; color: var(--text-dark); margin-bottom: 0.5rem; }

/* ?? Cards ?? */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.card-header {
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    font-weight: 600;
}

/* ?? Footer ?? */
.footer-public {
    background: var(--white);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    border-top: 3px solid var(--primary-color);
    flex-shrink: 0;
    width: 100%;
}

.footer-public p          { margin-bottom: 0.5rem; color: var(--text-dark); }
.footer-public .text-muted { color: var(--text-muted) !important; font-size: 0.9rem; }

/* ?? Misc ?? */
.success-icon    { font-size: 5rem; color: var(--success-color); margin-bottom: 1.5rem; }
.success-message { max-width: 600px; margin: 0 auto; text-align: center; }

.toast { border-radius: 0.5rem; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.job-details-header {
    color: var(--white);
    padding: 2rem;
    margin: -2.5rem -2.5rem 2rem -2.5rem;
    border-radius: 1rem 1rem 0 0;
}

.job-details-title { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }

.detail-section { margin-bottom: 2rem; }
.detail-section h3 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.form-section {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}

.form-section h4 { color: var(--primary-color); font-weight: 600; margin-bottom: 1.5rem; }

.error-container { text-align: center; padding: 4rem 2rem; }
.error-icon      { font-size: 6rem; color: var(--danger-color); margin-bottom: 2rem; }
.error-title     { font-size: 2.5rem; font-weight: 700; color: var(--text-dark); margin-bottom: 1rem; }
.error-message   { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 2rem; }

/* ?? Carousel (Jobs site) ?? */
.hero-carousel-wrapper {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-bottom: 0;
}

.hero-carousel { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); }
.hero-carousel .carousel-item { height: 450px; background: transparent; }

.hero-carousel-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    height: 380px;
}

.hero-carousel-text {
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-carousel-title       { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; line-height: 1.2; }
.hero-carousel-description { font-size: 1rem; line-height: 1.6; margin-bottom: 1.5rem; opacity: 0.95; }

.hero-carousel-features {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.hero-carousel-features h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; color: white; }
.hero-carousel-features ul { list-style: none; padding: 0; margin: 0; }
.hero-carousel-features li {
    padding: 0.4rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: white;
    font-size: 0.9rem;
}

.hero-carousel-features li::before {
    /* Use a Font Awesome check icon inside the circular marker */
    content: "\f00c";
    font-family: "Font Awesome 7 Free";
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    color: white;
    flex-shrink: 0;
    font-size: 0.8rem;
    line-height: 1;
}

.hero-carousel-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
}

.hero-carousel-image img   { width: 100%; height: 100%; object-fit: cover; }
.hero-carousel-placeholder { font-size: 5rem; color: rgba(255,255,255,0.3); }

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 50px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.hero-carousel .carousel-control-prev { left: 2rem; right: auto; }
.hero-carousel .carousel-control-next { right: 2rem; left: auto; }
.hero-carousel .carousel-control-prev:hover,
.hero-carousel .carousel-control-next:hover { opacity: 1; }

.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon { display: none; }

.hero-carousel .carousel-control-prev::before,
.hero-carousel .carousel-control-next::before {
    font-family: "Font Awesome 7 Free";
    font-weight: 900;
    font-size: 2rem;
    color: white;
}

.hero-carousel .carousel-control-prev::before { content: "\f053"; }
.hero-carousel .carousel-control-next::before { content: "\f054"; }

.hero-carousel .carousel-indicators { margin-bottom: 1rem; }
.hero-carousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 0.4rem;
    background-color: rgba(255,255,255,0.5);
    border: none;
}

.hero-carousel .carousel-indicators button.active {
    background-color: white;
    transform: scale(1.2);
}

/* ?? Responsive ?? */
@media (max-width: 768px) {
    html, body { max-width: 100%; overflow-x: hidden; }
    body { width: 100vw; }

    .container {
        padding-left: 15px;
        padding-right: 15px;
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
    }

    .navbar-public { padding-left: 0; padding-right: 0; }
    .navbar-public .container { padding-left: 15px; padding-right: 15px; }

    .hero-section h1 { font-size: 1.75rem; }
    .hero-section p  { font-size: 1rem; }

    .public-content {
        padding: 1.5rem;
        margin: 1rem 15px;
        width: calc(100% - 30px);
        max-width: calc(100vw - 30px);
    }

    .hero-section {
        padding: 2rem 1rem;
        margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    }

    .job-details-header { padding: 1.5rem; margin: -1.5rem -1.5rem 1.5rem -1.5rem; }
    .job-details-title  { font-size: 1.5rem; }
    .form-section       { padding: 1.5rem; }

    .row  { margin-left: 0; margin-right: 0; }
    .d-flex { flex-wrap: wrap; }
    .job-card { max-width: 100%; }

    .form-control, .form-select, input, textarea {
        max-width: 100%;
        box-sizing: border-box;
    }

    #toastContainer { left: 15px; right: 15px; width: auto; }

    .hero-carousel .carousel-item { height: auto; }
    .hero-carousel-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
        height: auto;
    }
    .hero-carousel-image  { height: 250px; order: -1; }
    .hero-carousel-title  { font-size: 1.6rem; }
}

@media (max-width: 576px) {
    .hero-carousel-wrapper { display: none !important; }

    .public-content {
        margin: 0.5rem 10px;
        padding: 1rem;
        width: calc(100% - 20px);
        max-width: calc(100vw - 20px);
        border-radius: 0.5rem;
    }

    .hero-section {
        padding: 1.5rem 1rem;
        margin: -1rem -1rem 1rem -1rem;
    }

    .form-section  { padding: 1rem; }
    .container     { padding-left: 10px; padding-right: 10px; }

    .hero-carousel-title       { font-size: 1.4rem; }
    .hero-carousel-description { font-size: 0.9rem; }
    .hero-carousel-features    { padding: 0.75rem; }
    .hero-carousel-features li { font-size: 0.85rem; }
    .hero-carousel-image       { height: 200px; }
}
