/* Base Variables */
:root {
    --primary: #1a365d;
    --secondary: #f7f7f7;
    --accent: #2c5282;
    --text: #2d3748;
    --border: #e2e8f0;
    --background: #f0f2f5;
    --success: #22c55e;
    --info: #3b82f6;
    --warning: #f59e0b;
}

/* Popup Overlay */
.job-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

/* Popup Content */
.job-popup-content {
    background: var(--background);
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    border-radius: 12px;
    position: relative;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}

/* Close Button */
.popup-close {
    position: absolute;
    top: 0.1rem;
    right: 0.1rem;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.popup-close:hover {
    background: var(--secondary);
    transform: rotate(90deg);
}

/* Grid Layout */
.popup-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1.75rem;
    margin-bottom: 1.75rem;
    border: 1px solid var(--border);
}

/* Job Header */
.job-header {
    margin-bottom: 1.75rem;
}

.popup-job-title {
    color: var(--primary);
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 1.25rem;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.popup-job-title i {
    color: var(--accent);
}

/* Meta Information */
.meta-info {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 1.25rem 0;
    align-items: center;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
    background: var(--secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
}

.meta-item i {
    color: var(--accent);
    font-size: 1.1rem;
}

/* Salary Display */
.salary {
    color: var(--accent);
    font-size: 20px;
    font-weight: 700;
    margin: 1.25rem 0;
    padding: 1.25rem;
    background: var(--secondary);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.875rem;
}

.salary i {
    font-size: 1.5rem;
}

.salary-estimate {
    color: var(--primary);
    font-size: 20px;
    font-weight: 600;
    margin-top: 1rem;
    padding: 1rem;
    background: #f0f9ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Section Titles */
.section-title {
    color: var(--primary);
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 1.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
}

.section-title i {
    color: var(--accent);
}

.subsection-title {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.subsection-title i {
    color: var(--accent);
}

.subsection-subtitle {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.75rem 0;
}

/* List Items */
.list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--secondary);
    transition: all 0.2s ease;
}

.list-item:hover {
    transform: translateX(4px);
    background: #f0f9ff;
}

.list-item i {
    color: var(--accent);
    margin-top: 0.25rem;
    font-size: 1.1rem;
}

/* Requirements Section */
.requirements-container {
    padding: 0.5rem;
}

.requirements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.requirement-item {
    background: var(--secondary);
    padding: 1.25rem;
    border-radius: 8px;
}

.education, .experience {
    margin-top: 0.75rem;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text);
}

.requirement-skills {
    margin-top: 1.5rem;
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0;
}

.tag {
    background: var(--secondary);
    padding: 0.625rem 1.25rem;
    border-radius: 20px;
    font-size: 1.05rem;
    display: inline-block;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.tag:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

/* Market Insights */
.insights-container {
    padding: 0.5rem;
}

.insight-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--secondary);
    border-radius: 12px;
}

.insight-section:last-child {
    margin-bottom: 0;
}

/* Role Significance */
.significance-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    font-size: 1.1rem;
}

.significance-item i {
    color: var(--accent);
}

/* Market Demand */
.demand-level {
    margin: 1rem 0;
    font-size: 1.1rem;
    color: var(--text);
}

/* Skill Importance Section */
.skill-importance-section {
    margin-top: 1.25rem;
}

.critical-skills, .beneficial-skills {
    margin-bottom: 1.5rem;
}

.critical-skills h4, .beneficial-skills h4 {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.skills-list.critical .tag {
    background: #F0F7FF;
    color: #0A4B8C;
    border-color: #2B85D8;
}

.skills-list.critical .tag:hover {
    background: #E1EFFF;
    color: #06315C;
}

.skills-list.beneficial .tag {
    background: #F0F9F6;
    color: #0B6B4F;
    border-color: #34A885;
}

.skills-list.beneficial .tag:hover {
    background: #E1F4EE;
    color: #085440;
}

/* Career Growth */
.career-growth {
    margin-top: 1rem;
}

.timeframe {
    margin-top: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    font-size: 1.1rem;
    color: var(--text);
}

/* Company Information */
.company-info {
    line-height: 1.8;
}

.company-header {
    margin-bottom: 1.5rem;
}

.company-name {
    font-size: 1.5rem !important;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 1rem;
}

.company-description {
    color: var(--text);
    font-size: 1.1rem;
}

.company-meta {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--secondary);
    border-radius: 8px;
}

.company-meta-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    display: flex;
    gap: 0.75rem;
    font-size: 1.05rem;
}

.company-meta-item:last-child {
    margin-bottom: 0;
}

.company-meta-item i {
    color: var(--accent);
}

/* Unique Aspects */
.unique-aspects-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.unique-aspects-list .list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.5rem;
    border-radius: 8px;
    background: var(--secondary);
    transition: all 0.2s ease;
}

.unique-aspects-list .list-item:hover {
    transform: translateX(4px);
    background: #f0f9ff;
}

.unique-aspects-list .unique-bullet {
    color: var(--accent);
}

.unique-aspects-list .unique-bullet::before {
    content: "✦";
}

.unique-aspects-list .unique-text {
    flex: 1;
}

/* Ad Containers */
.ad-container {
    background: white;
    border-radius: 8px;
    margin: 2rem auto;
    padding: 1rem;
    position: relative;
    border: 2px dashed var(--border);
}

.ad-label {
    text-align: center;
    color: #94a3b8;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding-bottom: 0.5rem;
    text-transform: uppercase;
}

.ad-space {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-style: italic;
    min-height: 250px;
}

.horizontal-ad .ad-space {
    min-height: 90px;
}

/* Apply Button */
.apply-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
    color: white;
    padding: 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(44, 82, 130, 0.1);
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
}

.apply-button:hover {
    color: white;
    box-shadow: 0 6px 12px rgba(44, 82, 130, 0.2);
}

/* Loading & Error States */
.popup-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 1000;
}

.popup-error {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    font-size: 1.1rem;
}

/* disclaimer */
.disclaimer-text-popup {
    color: var(--text);
    line-height: 1.6;
    font-size: 0.9375rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .popup-grid {
        grid-template-columns: 1fr;
    }

    .job-popup-content {
        padding: 1rem;
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }

    .meta-info {
        flex-direction: row;
        gap: 0.75rem;
    }

    .popup-close {
        top: 0.5rem;
        right: 0.5rem;
    }

    .popup-job-title {
        font-size: 25px;
    }

    .salary {
        font-size: 20px;
        padding: 1rem;
    }
    
    .salary-estimate {
        font-size: 15px;
    }

    .requirements-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1.25rem;
    }

    .section-title {
        font-size: 1.35rem;
    }

    .subsection-title {
        font-size: 1.15rem;
    }

    .insight-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .tag {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }

    .company-meta-item {
        font-size: 1rem;
    }

    .list-item {
        padding: 0.625rem;
        font-size: 1rem;
    }

    .unique-aspect {
        font-size: 1rem;
    }

    .significance-item {
        font-size: 1rem;
    }

    .timeframe {
        font-size: 1rem;
    }

    .ad-container {
        width: 100%;
    }

    .apply-button {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--primary);
    }

    .meta-item {
        border: 1px solid var(--text);
    }

    .tag {
        border: 2px solid currentColor;
    }

    .list-item {
        border: 1px solid var(--text);
    }

    .demand-bar {
        border: 1px solid var(--text);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .list-item:hover,
    .tag:hover,
    .apply-button:hover,
    .unique-aspect:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .job-popup-overlay {
        position: relative;
        background: none;
        padding: 0;
    }

    .job-popup-content {
        box-shadow: none;
    }

    .popup-close,
    .ad-container,
    .apply-button {
        display: none !important;
    }

    .popup-grid {
        grid-template-columns: 1fr;
    }

    .card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: none;
        box-shadow: none;
    }

    .section-title {
        border-bottom: 1px solid #000;
    }

    .tag {
        border: 1px solid #000;
    }
}