* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Roboto Mono", monospace;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    transition: background 0.5s ease;
}

/* Light and Dark Theme */
body.dark {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

body.light {
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
}

/* Background Particles */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="90" r="1" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    opacity: 0.3;
    animation: particleMove 20s linear infinite;
    z-index: -1;
    /* Lower z-index to avoid overlap */
}

body.light::before {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="10" cy="10" r="1" fill="rgba(0,0,0,0.1)"/><circle cx="90" cy="90" r="1" fill="rgba(0,0,0,0.1)"/></svg>') repeat;
}

@keyframes particleMove {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 100px 100px;
    }
}

/* Floating Elements */
.floating-element {
    position: absolute;
    border-radius: 50%;
    background: rgba(96, 165, 250, 0.2);
    animation: float 10s ease-in-out infinite;
    z-index: -1;
    /* Lower z-index to avoid overlap */
    pointer-events: none;
    /* Prevent clicks on floating elements */
}

.floating-element:nth-child(1) {
    width: 150px;
    height: 150px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    width: 100px;
    height: 100px;
    bottom: 15%;
    right: 15%;
    animation-delay: 2s;
}

.floating-element:nth-child(3) {
    width: 80px;
    height: 80px;
    top: 50%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.container {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 40px;
    width: 100%;
    max-width: 650px;
    min-height: 200px;       /* Optional: prevents collapsing too much */
    max-height: 100%;
    overflow: auto;
    animation: glow 2s ease-in-out infinite alternate;
    position: relative;
    z-index: 1;
    transition: background 0.5s ease, border 0.5s ease;
    pointer-events: auto;
    flex: 1 1 100%;
}

body.light .container {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

@keyframes glow {
    0% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    100% {
        box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
    }
}

body.light .container {
    animation: glow-light 2s ease-in-out infinite alternate;
}

@keyframes glow-light {
    0% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }

    100% {
        box-shadow: 0 8px 32px rgba(59, 130, 246, 0.2);
    }
}

.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.header h1 {
    font-family: "Orbitron", sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

body.light .header h1 {
    color: #2563eb;
    text-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

.header p {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 8px;
    letter-spacing: 1px;
}

body.light .header p {
    color: #4b5563;
}

.section {
    margin-bottom: 30px;
    position: relative;
}

.section h2 {
    font-family: "Orbitron", sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #a5b4fc;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
}

body.light .section h2 {
    color: #3b82f6;
}

.section h2::before {
    content: "▶";
    color: #60a5fa;
    font-size: 14px;
    animation: pulse 1.5s infinite;
}

body.light .section h2::before {
    color: #2563eb;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.upload-area,
.job-description {
    border: 2px dashed #60a5fa;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    /* Ensure interactivity */
}

body.light .upload-area,
body.light .job-description {
    border-color: #2563eb;
    background: rgba(0, 0, 0, 0.05);
}

.upload-area::before,
.job-description::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.2), transparent);
    transition: 0.5s;
}

body.light .upload-area::before,
body.light .job-description::before {
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.2), transparent);
}

.upload-area:hover::before,
.job-description:hover::before {
    left: 100%;
}

.upload-area:hover,
.job-description:hover {
    border-color: #93c5fd;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(96, 165, 250, 0.2);
}

body.light .upload-area:hover,
body.light .job-description:hover {
    border-color: #60a5fa;
    background: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.2);
}

.upload-area p,
.job-description textarea {
    color: #cbd5e1;
    font-size: 14px;
}

body.light .upload-area p,
body.light .job-description textarea {
    color: #4b5563;
}

.job-description textarea {
    width: 100%;
    height: 120px;
    background: transparent;
    border: none;
    resize: none;
    outline: none;
    color: #e2e8f0;
    font-size: 14px;
}

body.light .job-description textarea {
    color: #1f2937;
}

.analysis-settings {
    display: flex;
    align-items: center;
    gap: 15px;
}

.analysis-settings label,
.analysis-settings span {
    color: #e2e8f0;
    font-size: 14px;
}

body.light .analysis-settings label,
body.light .analysis-settings span {
    color: #1f2937;
}

.analysis-settings input[type="number"] {
    width: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #60a5fa;
    border-radius: 5px;
    padding: 8px;
    color: #e2e8f0;
    outline: none;
    transition: all 0.3s ease;
    -moz-appearance: textfield;
}

.analysis-settings input[type="number"]::-webkit-outer-spin-button,
.analysis-settings input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

body.light .analysis-settings input[type="number"] {
    background: rgba(0, 0, 0, 0.1);
    border-color: #2563eb;
    color: #1f2937;
}

.analysis-settings input[type="number"]:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #93c5fd;
}

body.light .analysis-settings input[type="number"]:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: #60a5fa;
}

.process-btn {
    display: block;
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
    padding: 14px 30px;
    background: linear-gradient(45deg, #60a5fa, #a78bfa);
    border: none;
    border-radius: 30px;
    color: #ffffff;
    font-family: "Orbitron", sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    pointer-events: auto;
}

body.light .process-btn {
    background: linear-gradient(45deg, #2563eb, #7c3aed);
}

.process-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.5s;
}

.process-btn:hover::before {
    left: 100%;
}

.process-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.5);
}

body.light .process-btn:hover {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
}



body.light .theme-toggle {
    background: rgba(0, 0, 0, 0.1);
    border-color: #2563eb;
    color: #1f2937;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #93c5fd;
}

body.light .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: #60a5fa;
}

#results-panel .details-btn:hover {
    background-color: #1e40af !important;
}

body.light #results-panel .details-btn {
    background-color: #3b82f6;
    color: white;
}

body.light #results-panel .details-btn:hover {
    background-color: #1d4ed8 !important;
}

#results-panel .export-btn {
    margin-bottom: 15px;
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer !important;
    font-size: 14px;
    transition: background-color 0.3s ease;
    pointer-events: auto !important;
    user-select: none;
    display: inline-block;
}

#results-panel .export-btn:hover {
    background-color: #1d4ed8 !important;
}

#results-panel {
    pointer-events: auto !important;
    /* Ensure panel is interactive */
}

#results-panel .result-item {
    pointer-events: auto !important;
    /* Ensure items are interactive */
}

@media (max-width: 480px) {
    .container {
        padding: 25px;
    }

    .header h1 {
        font-size: 28px;
    }

    .section h2 {
        font-size: 16px;
    }

    .process-btn {
        max-width: 100%;
        padding: 12px 20px;
    }
}

.main-layout {
    display: flex;
    gap: 30px;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
    }

    #results-panel {
        width: 100%;
        max-width: 100%;
        padding: 20px;
    }
}

#results-panel {
    flex: 1;
    width: 100%;
    background: rgba(30, 41, 59, 0.95);
    border-radius: 16px;
    padding: 30px;
    max-width: 700px;
    min-width: 500px; 
    height: auto;
    max-height: 600px;
    overflow-y: auto;
    font-family: "Roboto Mono", monospace;
    color: #e2e8f0;
    animation: glow 2s ease-in-out infinite alternate;
}

body.light #results-panel {
    background: rgba(255, 255, 255, 0.95);
    animation: glow-light 2s ease-in-out infinite alternate;
    color: #1e293b;
}

.result-item {
    border-bottom: 1px solid #334155;
    padding: 12px 0;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item h3 {
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-family: "Orbitron", sans-serif;
}

.match-score {
    font-weight: bold;
    color: #60a5fa;
}

body.light .match-score {
    color: #2563eb;
}



body.light .details-btn {
    background-color: #3b82f6;
    color: white;
}

body.light .details-btn:hover {
    background-color: #3669f3;
}

.details-content {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

.details-content.show {
    display: block;
}

.form-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    display: none;
    z-index: 10;
    backdrop-filter: blur(2px);
}

.export-btn {
    margin-bottom: 15px;
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    pointer-events: auto;
    /* Ensure clicks are detected */
}

.spinner {
    margin-top: 20px;
    width: 40px;
    height: 40px;
    border: 4px solid #93c5fd;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 5;
    position: relative;
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .section h2 {
        font-size: 14px;
    }

    .spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.stats-line {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 6px;
}

.format-warning {
    background-color: #fde68a;
    color: #7c2d12;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.original-file-btn {
    margin-top: 8px;
    background-color: #2c3e50;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
}

.original-file-btn:hover {
    background-color: #2980b9;
}

.details-btn,
.download-btn,
.preview-btn {
    margin-top: 8px;
    background-color: #2c3e50;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
}

/* Spacing between buttons */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.details-btn:hover {
    background-color: #1e40af;
}

.download-btn:hover {
    background-color: #1abc9c;
}

.preview-btn:hover {
    background-color: #3498db;
}

.info-dialog {
    display: none;
    position: absolute;
    top: 55px;
    left: 160px;
    max-width: 400px;
    background-color: #1e293b;
    color: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.8;
    z-index: 1000;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
    font-family: "Roboto Mono", monospace;
}

body.light .info-dialog {
    background-color: #f1f5f9;
    color: #1e293b;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
}


/* Toolbar Buttons */

/* Toolbar Buttons */
.toolbar-fixed {
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    padding: 10px;
    background: transparent;
    border-radius: 6px;
    /**box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);**/
    z-index: 999;
}

.theme-toggle,
.info-btn {
    background-color: transparent;
    /* Transparent background */
    color: white;
    border: 1px solid transparent;
    /* No border */
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    padding: 8px 12px;
    /* Ensure both buttons have the same padding */
    border-radius: 20px;
    /* Rounded corners */
    min-width: fit-content;
    outline: none;
    /* Remove outline for better appearance */
}

.theme-toggle:hover,
.info-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    /* Slight background on hover */
    transform: scale(1.05);
    /* Slight enlargement on hover */
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: auto;
}


body.light .theme-toggle,
body.light .info-btn {
    background-color: #e2e8f0;
    color: #1e293b;
}

body.light .theme-toggle:hover,
body.light .info-btn:hover {
    background-color: #cbd5e1;
}

/* Modal Base */
.info-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(30, 41, 59, 0.9);
    animation: fadeIn 0.4s;
}

/* Modal Content Box */
.info-modal-content {
    background-color: #0f172a;
    margin: 10% auto;
    padding: 30px 40px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    color: #f8fafc;
    font-size: 16px;
    font-family: "Roboto Mono", monospace;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    animation: scaleIn 0.3s;
}

/* Light Theme Variant */
body.light .info-modal {
    background-color: rgba(240, 240, 240, 0.85);
}

body.light .info-modal-content {
    background-color: #f8fafc;
    color: #1e293b;
}

/* Close Button */
.close-btn {
    color: #f87171;
    float: right;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    margin-top: -10px;
    margin-right: -10px;
}

.close-btn:hover {
    color: #ef4444;
}

/* Lists */
.info-modal-content ul {
    margin-top: 10px;
    padding-left: 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.info-modal-content h2,
.info-modal-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
}

.info-modal-content p,
.info-modal-content ul {
    margin-bottom: 16px;
}

.info-modal-content ul {
    padding-left: 20px;
}

#status-text {
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
    color: #93c5fd;
    font-size: 14px;
}

.missing-skills {
    display: block;
    margin-top: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}