/* ---
Functional CSS with Updated Color Palette
- Colors: Refined dark theme from the "Codepen" version.
- Structure: Reverted to the previous functional layout (system fonts, standard scrollbars, no extra animations).
--- */

/* --- 1. NEW: Color variables --- */
:root {
    --bg-color: #111827;         /* Very dark, cool navy */
    --container-bg: #1F2937;    /* Dark slate blue */
    --input-bg: #374151;        /* Lighter grey-blue for inputs */
    --border-color: #4B5563;    /* Mid-grey for subtle borders */
    
    --primary-accent: #38BDF8;   /* Sky Blue */

    --text-primary: #F9FAFB;     /* Off-white */
    --text-secondary: #9CA3AF;   /* Muted grey for secondary text */
}

/* --- 2. Global Styles (Reverted to system fonts) --- */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    height: auto;
}

.hidden { display: none !important; }

/* --- 3. Main Layout --- */
#layout-wrapper {
    display: flex;
    gap: 20px;
    width: 95%;
    max-width: 1400px;
    margin-top: 40px;
    margin-left: auto;
    margin-right: auto;
    align-items: flex-start;
}

#history-panel, #main-content {
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#app-container {
    flex-grow: 1;
    margin: 0;
    width: 100%;
}

#history-panel {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: calc(100vh - 80px);
}

/* --- 4. Component Styles (Reverted to simpler styles) --- */

/* History Panel */
#history-header { padding: 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
#history-header h3 { margin: 0; font-size: 1.2em; }
#clear-history-button { background: none; border: 1px solid var(--border-color); color: var(--text-secondary); padding: 4px 10px; border-radius: 5px; cursor: pointer; font-size: 0.8em; transition: all 0.2s; }
#clear-history-button:hover { background-color: #ef4444; color: white; border-color: #ef4444; }

#history-list { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; background-color: var(--input-bg); border: 1px solid transparent; border-radius: 6px; cursor: pointer; transition: background-color 0.2s; }
.history-item:hover { background-color: #4a5468; }
.history-item.active { background-color: var(--primary-accent); color: var(--bg-color); border-color: var(--primary-accent); }
.history-item.active .history-item-date { color: #111827b3; }
.history-item-score { font-weight: bold; font-size: 1.1em; }
.history-item-date { font-size: 0.8em; color: var(--text-secondary); }

/* Main Header & Content */
#app-header { padding: 20px; display: flex; justify-content: space-between; align-items: center; }
#app-header h1 { font-size: 2.0em; margin: 0; }
#edit-resume-button { padding: 8px 16px; background-color: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 6px; cursor: pointer; transition: background-color 0.2s; }
#edit-resume-button:hover { background-color: var(--border-color); }
#main-content { overflow: hidden; }
#results-dashboard { padding: 25px; }
#dashboard-placeholder { text-align: center; color: var(--text-secondary); padding: 40px 0; }
#results-content { display: flex; flex-direction: column; gap: 30px; }
.result-section h3 { margin-top: 0; margin-bottom: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.content-box { background-color: var(--input-bg); padding: 15px 20px; border-radius: 6px; line-height: 1.7; white-space: pre-wrap; font-size: 0.95em; }
.content-box strong { color: var(--primary-accent); } /* Keep the bold color highlight */

/* Progress Bar (Reverted to solid color) */
.progress-bar-container { width: 100%; background-color: #4B5563; border-radius: 8px; position: relative; height: 30px; }
#progress-bar-fill { width: 0%; height: 100%; background-color: var(--primary-accent); border-radius: 8px; transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1); }
#score-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-weight: bold; font-size: 1em; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }

/* Forms & Inputs (Reverted to simpler focus) */
#jd-form { display: flex; flex-direction: column; padding: 25px; background-color: #161e2b; border-top: 1px solid var(--border-color); }
#jd-form label { font-weight: bold; margin-bottom: 10px; font-size: 1.1em; }
textarea { background-color: var(--container-bg); border: 1px solid var(--border-color); resize: vertical; color: var(--text-primary); font-size: 1em; padding: 15px; outline: none; border-radius: 8px; transition: border-color 0.2s; min-height:300px;}
textarea:focus { border-color: var(--primary-accent); }
textarea[readonly] { background-color: var(--container-bg); cursor: default; opacity: 0.8; }
textarea[readonly]:focus { outline: none; }
.form-footer, .editor-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.char-counter { font-size: 0.8em; color: var(--text-secondary); }
.char-counter.warning { color: #facc15; }
.char-counter.limit-reached { color: #f87171; }

/* Buttons */
#run-button, #save-resume-button { padding: 10px 25px; border: none; background-color: var(--primary-accent); color: var(--bg-color); border-radius: 6px; font-size: 1em; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background-color 0.2s; }
#run-button:hover, #save-resume-button:hover { background-color: #0EA5E9; } /* A darker shade of the accent */
#run-button:disabled { background-color: #4B5563; cursor: not-allowed; color: var(--text-secondary); }

#new-analysis-button { padding: 10px 25px; border: 1px solid var(--primary-accent); background-color: transparent; color: var(--primary-accent); border-radius: 6px; font-size: 1em; cursor: pointer; transition: all 0.2s; }
#new-analysis-button:hover { background-color: var(--primary-accent); color: var(--bg-color); }

/* --- 5. Resume Overlay & Footer (Unchanged from previous functional version) --- */
#resume-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(17, 24, 39, 0.8); backdrop-filter: blur(5px); z-index: 100; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
#resume-overlay.visible { opacity: 1; visibility: visible; }
#resume-editor { background-color: var(--container-bg); padding: 30px; border-radius: 12px; width: 90%; max-width: 800px; height: 80vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); border: 1px solid var(--border-color); transform: scale(0.95); transition: transform 0.3s ease; }
#resume-overlay.visible #resume-editor { transform: scale(1); }
#resume-editor h2 { margin-top: 0; }
#resume-input { flex-grow: 1; }

#app-footer { text-align: center; color: var(--text-secondary); font-size: 0.9em; padding: 80px 0 0 0;  }
#app-footer a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s; }
#app-footer a:hover { color: var(--primary-accent); }
#app-footer span { margin: 0 10px; }


/* --- 6. Responsive Design for Mobile Devices --- */
@media (max-width: 768px) {
    
    /* 1. Stack the main layout vertically instead of side-by-side */
    #layout-wrapper {
        flex-direction: column;
        margin: 20px 15px; /* Reduce outer margins for smaller screens */
        gap: 20px;
    }

    /* 2. Make both panels take up the full width */
    #history-panel,
    #app-container {
        width: 100%;
    }

    /* 3. Adjust history panel height to be content-based, not screen-based */
    #history-panel {
        height: auto; /* Let the content define the height */
        max-height: 40vh; /* But prevent it from taking over the entire screen */
    }

    /* 4. Tweak font sizes and padding for a better mobile experience */
    #app-header h1 {
        font-size: 1.5em;
    }

    #results-dashboard,
    #jd-form {
        padding: 20px;
    }

    /* 5. Make the resume editor overlay more mobile-friendly */
    #resume-editor {
        height: 90vh; /* Use more of the vertical space */
        padding: 20px;
    }
}

#logo-container {
    display: flex;
    align-items: center;
    gap: 0px;
    /* NEW: Set the desired color here! */
    color: white; /* We set the color on the parent container */
}

#app-logo {
    width: 60px;
    height: 60px;
    transition: transform 0.3s ease;
    color:white;
    margin-bottom: 3px;
}

/* Target the path elements inside the SVG */
#app-logo path {
    fill: currentColor;
}


#app-logo:hover {
    transform: scale(1.1) rotate(-5deg);
}