@import "../util/util.css";

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--primary--background);
    color: var(--white-color);
    min-height: 100vh;
}

body.has-banner {
    padding-top: 52px; /* Height compensation for CERT-IN banner */
}

/* Navbar positioning with banner */
.navbar {
    position: fixed;
    top: 52px; /* Position below CERT-IN banner */
    left: 0;
    right: 0;
    z-index: 10050;
    width: 100%;
}

/* Ensure header overlay is above CERT-IN banner */
.header__overlay {
    z-index: 100000 !important;
    top: 0 !important;
}

.header__overlay__section {
    z-index: 100000 !important;
}

/* Hide close button when overlay is closed */
.header__overlay .header__overlay__closebtn {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Show close button only when overlay is explicitly open */
.header__overlay[style*="width: 32%"] .header__overlay__closebtn,
.header__overlay[style*="width: 35%"] .header__overlay__closebtn,
.header__overlay[style*="width: 100%"] .header__overlay__closebtn {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Adjust container padding for navbar + banner */
body.has-banner .career-container {
    margin-top: 120px; /* Space for navbar (72px) + banner (52px) */
}

/* Career Page Container */
.career-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Page Title */
.page-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary--element);
    margin-bottom: 25px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary--element);
    display: inline-block;
    font-family: 'Roboto', sans-serif;
}

/* Filters Section */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
    background-color: var(--secondary--background);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(102, 252, 241, 0.2);
}

.filters select,
.filters input[type="text"] {
    padding: 10px 12px;
    border: 1px solid var(--primary--element);
    border-radius: 6px;
    background-color: var(--primary--background);
    color: var(--white-color);
    font-size: 15px;
    font-family: 'Roboto', sans-serif;
    flex-grow: 1;
    min-width: 180px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%2366fcf1" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px top 50%;
    transition: all 0.3s ease;
}

.filters select:focus,
.filters input[type="text"]:focus {
    outline: none;
    border-color: var(--secondary--element);
    box-shadow: 0 0 10px rgba(102, 252, 241, 0.3);
}

.filters select option {
    background-color: var(--secondary--background);
    color: var(--white-color);
}

.filters .search-bar {
    position: relative;
    flex-grow: 2;
}

.filters .search-bar input {
    width: calc(100% - 40px);
    padding-right: 40px;
}

.filters .search-bar img {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

/* Remote Toggle */
.remote-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white-color);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}

.remote-toggle input[type="checkbox"] {
    position: relative;
    width: 40px;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--secondary--background);
    border: 1px solid var(--primary--element);
    border-radius: 10px;
    cursor: pointer;
    outline: none;
    transition: background-color 0.3s;
}

.remote-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: var(--white-color);
    border-radius: 50%;
    transition: left 0.3s, background-color 0.3s;
}

.remote-toggle input[type="checkbox"]:checked {
    background-color: var(--primary--element);
    border-color: var(--primary--element);
}

.remote-toggle input[type="checkbox"]:checked::before {
    left: 22px;
    background-color: var(--primary--background);
}

/* Department Section */
.department-section {
    margin-bottom: 25px;
}

.department-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--secondary--background);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary--element);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.department-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--white-color);
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
}

.department-header .open-roles {
    background-color: var(--primary--element);
    color: var(--primary--background);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
}

/* Job Card */
.job-card {
    background-color: var(--secondary--background);
    padding: 18px 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(102, 252, 241, 0.2);
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

.job-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 252, 241, 0.2);
    border-color: var(--primary--element);
}

.job-card-details {
    flex: 1;
    padding-right: 20px;
}

.job-card-details h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: var(--primary--element);
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
    line-height: 1.3;
}

.job-card-details p {
    margin: 0;
    color: var(--light--background);
    line-height: 1.5;
    font-size: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.job-card-meta {
    text-align: right;
    margin-right: 15px;
    min-width: 140px;
}

.job-card-meta .location {
    font-weight: 600;
    color: var(--white-color);
    margin-bottom: 4px;
    font-size: 15px;
}

.job-card-meta .work-type {
    font-style: italic;
    color: var(--light--background);
    font-size: 14px;
}

.job-card .arrow-icon {
    font-size: 24px;
    color: var(--primary--element);
    margin-left: 10px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.job-card:hover .arrow-icon {
    transform: translateX(5px);
}

/* No Results Message */
#jobListings p {
    text-align: center;
    margin-top: 40px;
    font-size: 16px;
    color: var(--light--background);
    font-style: italic;
}

/* Job Modal Styles */
.job-modal {
    display: none;
    position: fixed;
    z-index: 10060;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.job-modal-content {
    background-color: var(--secondary--background);
    margin: 5% auto;
    padding: 30px;
    border: 2px solid var(--primary--element);
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease;
    box-shadow: 0 10px 40px rgba(102, 252, 241, 0.3);
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.job-modal-close {
    color: var(--primary--element);
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
    transition: all 0.3s ease;
    line-height: 1;
}

.job-modal-close:hover {
    color: var(--white-color);
    transform: rotate(90deg);
}

.modal-job-title {
    color: var(--primary--element);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-right: 40px;
    font-family: 'Roboto', sans-serif;
}

.modal-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(102, 252, 241, 0.2);
}

.modal-meta-item {
    color: var(--light--background);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-meta-item i {
    color: var(--primary--element);
    font-size: 16px;
}

.modal-job-description,
.modal-job-summary,
.modal-job-section {
    margin-bottom: 30px;
}

.modal-job-description h3,
.modal-job-summary h3,
.modal-job-section h3 {
    color: var(--white-color);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    font-family: 'Roboto', sans-serif;
    border-bottom: 2px solid var(--primary--element);
    padding-bottom: 8px;
}

.modal-job-description p,
.modal-job-summary p {
    color: var(--light--background);
    font-size: 16px;
    line-height: 1.7;
    text-align: justify;
}

.modal-job-list {
    color: var(--light--background);
    font-size: 16px;
    line-height: 1.8;
    padding-left: 25px;
    margin: 0;
}

.modal-job-list li {
    margin-bottom: 12px;
    padding-left: 8px;
}

.modal-job-list li strong {
    color: var(--primary--element);
    font-weight: 700;
}

.modal-apply-section {
    background-color: rgba(102, 252, 241, 0.1);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary--element);
}

.modal-apply-section h3 {
    color: var(--primary--element);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    font-family: 'Roboto', sans-serif;
}

.modal-apply-section p {
    color: var(--light--background);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.apply-email-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary--element);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    padding: 12px 20px;
    background-color: rgba(102, 252, 241, 0.1);
    border: 2px solid var(--primary--element);
    border-radius: 8px;
    margin: 15px 0;
    transition: all 0.3s ease;
}

.apply-email-link:hover {
    background-color: var(--primary--element);
    color: var(--primary--background);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 252, 241, 0.4);
}

.apply-email-link i {
    font-size: 20px;
}

.apply-note {
    color: var(--light--background);
    font-size: 14px;
    font-style: italic;
    margin-top: 10px;
    opacity: 0.8;
}

/* Modal Scrollbar Styling */
.job-modal-content::-webkit-scrollbar {
    width: 8px;
}

.job-modal-content::-webkit-scrollbar-track {
    background: var(--primary--background);
    border-radius: 4px;
}

.job-modal-content::-webkit-scrollbar-thumb {
    background: var(--primary--element);
    border-radius: 4px;
}

.job-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary--element);
}

/* Responsive Design */
@media (max-width: 1080px) {
    body.has-banner {
        padding-top: 48px;
    }
    .navbar {
        top: 48px;
    }
    body.has-banner .career-container {
        margin-top: 115px;
    }
}

@media (max-width: 768px) {
    body.has-banner {
        padding-top: 45px;
    }
    .navbar {
        top: 45px;
    }
    body.has-banner .career-container {
        margin-top: 110px;
    }
    .career-container {
        margin: 20px auto;
        padding: 0 15px;
    }

    .page-title {
        font-size: 28px;
        margin-bottom: 20px;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 12px;
    }

    .filters select,
    .filters input[type="text"] {
        min-width: unset;
        width: 100%;
        margin-bottom: 10px;
    }

    .remote-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .job-card {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .job-card-meta {
        margin-top: 12px;
        margin-right: 0;
        text-align: left;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .job-card .arrow-icon {
        display: none;
    }

    .department-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .department-header .open-roles {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    body.has-banner {
        padding-top: 40px;
    }
    .navbar {
        top: 40px;
    }
    body.has-banner .career-container {
        margin-top: 105px;
    }
    .career-container {
        margin: 15px auto;
        padding: 0 12px;
    }

    .page-title {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .filters {
        gap: 12px;
        padding: 12px;
    }

    .job-card {
        padding: 15px;
    }

    .job-card-details h3 {
        font-size: 16px;
    }

    .job-card-details p {
        font-size: 14px;
    }

    .department-header {
        padding: 12px 15px;
    }

    .department-header h2 {
        font-size: 18px;
    }

    .job-modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }

    .modal-job-title {
        font-size: 22px;
        padding-right: 30px;
    }

    .modal-job-meta {
        flex-direction: column;
        gap: 10px;
    }

    .modal-job-description h3,
    .modal-apply-section h3 {
        font-size: 18px;
    }

    .apply-email-link {
        font-size: 16px;
        padding: 10px 15px;
    }
}
