/* --- Unified Stylesheet --- */

/* CSS Variables & Reset */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --green-color: #16a34a;
    --green-hover: #15803d;
    --background-color: #f3f4f6;
    --surface-color: #ffffff;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #ffffff;
    --status-review-bg: #fef9c3;
    --status-review-text: #ca8a04;
    --status-viewed-bg: #dcfce7;
    --status-viewed-text: #16a34a;
    --status-rejected-bg: #fee2e2;
    --status-rejected-text: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
}

/* --- Main Layout --- */
.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background-color: var(--surface-color);
}

/* --- Header --- */
.header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

/* Header for Job List Page */
.header.header-main {
    justify-content: space-between;
}
.header-main .location-info .location-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.header-main .location-info .location-name {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 1.125rem;
    font-weight: 700;
}
.header-main .notification-bell {
    position: relative;
    cursor: pointer;
}
.header-main .notification-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 0.5rem;
    height: 0.5rem;
    background-color: #ef4444;
    border-radius: 9999px;
    border: 2px solid var(--surface-color);
}

/* Header for Sub-pages (like Apply) */
.header.header-page {
    gap: 1rem;
}
.header-page .back-arrow {
    color: var(--text-primary);
    text-decoration: none;
}
.header-page .header-title {
    font-size: 1.25rem;
    font-weight: 600;
}


/* --- Main Content Area --- */
main {
    flex-grow: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

/* --- Search Bar --- */
.search-bar {
    position: relative;
    margin-bottom: 1.5rem;
}
.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
}
.search-input:focus {
    outline: none;
    border-color: var(--green-color);
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.3);
}
.search-bar .icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}
.search-bar .icon-search { left: 0.75rem; }
.search-bar .icon-mic { right: 0.75rem; }

/* --- Card Styles (Job & Application) --- */
.job-listings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.job-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease-in-out;
}
.job-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.job-card-title { font-size: 1.125rem; font-weight: 700; }
.job-card-company { font-size: 0.875rem; color: var(--text-secondary); }
.job-card-logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-weight: 700;
    font-size: 1.25rem;
}
.logo-purple { background-color: #8b5cf6; }
.logo-blue { background-color: #3b82f6; }
.job-card-details {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.detail-item svg {
    width: 1rem;
    height: 1rem;
}
.job-card-footer {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.job-card-posted {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.apply-button {
    background-color: var(--green-color);
    color: var(--text-light);
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}
.apply-button:hover {
    background-color: var(--green-hover);
}

/* --- Application Form Styles --- */
.application-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.form-label {
    font-weight: 500;
    color: var(--text-primary);
}
.form-input, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    background-color: var(--surface-color);
}
.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.form-textarea {
    min-height: 100px;
    resize: vertical;
}
.upload-box {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    position: relative;
    min-height: 150px;
}
.upload-box:hover {
    border-color: var(--primary-color);
}
.upload-box.has-file {
    border-style: solid;
    border-color: var(--green-color);
    background-color: #f0fdf4;
}
.upload-box.has-file .upload-content {
    flex-direction: row;
    gap: 0.75rem;
    color: var(--green-hover);
    font-weight: 500;
}
.upload-box.has-file .upload-icon { display: none; }
.upload-box.has-file .pdf-icon { display: block; }
.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.upload-content svg {
    margin-bottom: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
}
.upload-box input[type="file"] { display: none; }
.pdf-icon {
    display: none; /* Hidden by default */
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}
.file-name { word-break: break-all; }
.phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.phone-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.phone-prefix {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-secondary);
    border-right: 1px solid var(--border-color);
}
.phone-input-wrapper .form-input {
    border: none;
    box-shadow: none;
}
.phone-input-wrapper .form-input:focus { box-shadow: none; }
.submit-button {
    width: 100%;
    background-color: var(--green-color);
    color: var(--text-light);
    font-weight: 700;
    font-size: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    margin-top: 1rem; /* Added margin for spacing */
}
.submit-button:hover {
    background-color: var(--green-hover);
}

/* --- My Applications Page --- */
.application-listings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.application-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.application-card .app-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}
.application-card .app-card-company {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}
.application-card .app-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.application-card .app-card-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.status-badge.status-review {
    background-color: var(--status-review-bg);
    color: var(--status-review-text);
}
.status-badge.status-viewed {
    background-color: var(--status-viewed-bg);
    color: var(--status-viewed-text);
}
.status-badge.status-rejected {
    background-color: var(--status-rejected-bg);
    color: var(--status-rejected-text);
}


/* --- Bottom Navigation (Mobile) --- */
.bottom-nav {
    order: 2; /* Puts nav at the bottom on mobile */
    position: sticky;
    bottom: 0;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem;
    display: flex;
    justify-content: space-around;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.2s ease-in-out;
}
.nav-item:hover {
    color: var(--primary-color);
}
.nav-item.active {
    color: var(--primary-color);
}
.nav-item svg {
    width: 24px;
    height: 24px;
}
.nav-item span {
    font-size: 0.75rem;
}
.nav-item.active span {
    font-weight: 600;
}

.select-wrapper {
    position: relative;
}

select.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2.5rem;
    cursor: pointer;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-medium);
    pointer-events: none;
}




/* --- Desktop Layout (Sidebar Navigation) --- */
@media (min-width: 768px) {
    .page-container {
        flex-direction: row;
        max-width: 1280px;
        margin: 0 auto;
    }
    .content-wrapper {
        box-shadow: 0 0 15px rgba(0,0,0,0.07);
    }
    .bottom-nav {
        order: 0; /* Puts nav at the start on desktop */
        position: sticky;
        top: 0;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        width: 240px;
        height: 100vh;
        border-top: none;
        border-right: 1px solid var(--border-color);
        padding: 2rem 1rem;
        gap: 1rem;
    }
    .nav-item {
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
        width: 100%;
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
    }
    .nav-item.active {
        background-color: #eef2ff;
    }
    .nav-item span {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    .header {
        padding: 0.75rem 1rem;
    }
    .content-wrapper {
        border-radius: 0;
    }
    .job-card-header,
    .app-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .job-card-footer,
    .app-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .job-card-logo {
        align-self: flex-start;
    }
    .apply-button {
        width: 100%;
        text-align: center;
    }
    .job-card-details {
        gap: 0.35rem;
    }
}
