/* Base styles for body and typography */
body {
    font-family: 'Inter', sans-serif; /* Using Inter font */
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    color: #333;
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition for dark mode */
}

/* Dark Mode styles */
body.dark-mode {
    background-color: #2c2c2c;
    color: #e0e0e0;
}

body.dark-mode .container {
    background-color: #3c3c3c;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 {
    color: #f0f0f0;
}

body.dark-mode h3 {
    color: #87ceeb; /* Lighter blue for dark mode sub-headings */
}

body.dark-mode h2 {
    border-bottom-color: #555;
}

body.dark-mode .input-field,
body.dark-mode .textarea-field {
    background-color: #4c4c4c;
    border-color: #666;
    color: #f0f0f0;
}

body.dark-mode .input-field::placeholder,
body.dark-mode .textarea-field::placeholder {
    color: #a0a0a0;
}

body.dark-mode .input-field:focus,
body.dark-mode .textarea-field:focus {
    border-color: #87ceeb;
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.3);
}

body.dark-mode .result {
    background-color: #444;
    border-color: #555;
    box-shadow: inset 0 1px 5px rgba(0,0,0,0.2);
}

body.dark-mode .result p,
body.dark-mode .result ul,
body.dark-mode .result li,
body.dark-mode .result a {
    color: #e0e0e0;
}

body.dark-mode .result hr {
    border-top-color: #666;
}

body.dark-mode .main-nav {
    background-color: #1a1a1a;
}

body.dark-mode .nav-link,
body.dark-mode .nav-button {
    color: #f0f0f0;
}

body.dark-mode .nav-link:hover,
body.dark-mode .nav-button:hover {
    color: #87ceeb;
}


body.dark-mode .dropdown-menu {
    background-color: #2a2a2a;
}

body.dark-mode .dropdown-item {
    color: #e0e0e0;
}

body.dark-mode .dropdown-item:hover {
    background-color: #4a4a4a;
    color: #fff;
}

body.dark-mode .dropdown-menu-sub { /* Style for nested dropdown in dark mode */
    background-color: #333;
}

body.dark-mode #matchJobDescriptionSection div.border {
    border-color: #555;
    background-color: #444;
}

body.dark-mode #matchJobDescriptionSection div.bg-gray-50 {
    background-color: #3a3a3a;
}

body.dark-mode #matchJobDescriptionSection h3,
body.dark-mode #matchJobDescriptionSection h4 {
    color: #f0f0f0;
}

body.dark-mode #matchJobDescriptionSection p,
body.dark-mode #matchJobDescriptionSection li {
    color: #e0e0e0;
}

/* Container for the form and result */
.container {
    max-width: 900px;
    margin: auto;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08); /* Softer, larger shadow */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Headings */
h1 {
    color: #2c3e50; /* Darker, more professional heading color */
    text-align: center;
    font-size: 2.5rem; /* Larger heading */
    margin-bottom: 1.5rem;
}

h2 {
    color: #34495e; /* Slightly lighter heading color */
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.8rem;
    text-align: center; /* Centered for better aesthetics */
    border-bottom: 2px solid #ecf0f1; /* Subtle underline */
    padding-bottom: 8px;
}

h3 {
    font-size: 1.4rem;
    color: #2980b9; /* A blue for sub-headings */
    margin-top: 20px;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px dashed #aed6f1; /* Lighter dashed line */
}

h4 {
    font-size: 1.2rem;
    color: #1a5276; /* Darker blue for sub-sub-headings */
    margin-top: 15px;
    margin-bottom: 5px;
}

/* Form Group Layout */
.form-group > div { /* Target the div wrapping each label and input/textarea */
    display: flex;
    flex-direction: column;
    gap: 4px; /* Small gap between label and input */
}

.form-group {
    display: grid; /* Changed to grid for consistent column layout */
    grid-template-columns: 1fr; /* Default to single column for mobile */
    gap: 15px; /* Gap between form group items */
    margin-bottom: 25px;
}

/* Input and Textarea Styling */
.input-field, .textarea-field {
    padding: 12px;
    border: 1px solid #dcdcdc; /* Lighter border */
    border-radius: 8px; /* More rounded corners */
    font-size: 16px;
    transition: all 0.3s ease; /* Smooth transitions for focus */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06); /* Subtle inner shadow */
    width: 100%; /* Ensure they take full width of their parent div */
}

.input-field:focus, .textarea-field:focus {
    border-color: #3498db; /* Blue focus border */
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2); /* Light blue focus halo */
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 90px;
}

/* Button Group Layout */
.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center buttons */
    gap: 15px; /* Increased gap */
    margin-top: 30px;
}

/* Action Buttons */
.action-button {
    flex: 1 1 auto; /* Allow buttons to grow and shrink */
    max-width: 220px; /* Max width for larger screens */
    padding: 14px 20px; /* More padding */
    font-size: 17px; /* Slightly larger font */
    color: white;
    background-color: #090b0d; /* Default background */
    border: none;
    border-radius: 8px; /* More rounded */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease; /* Smooth transitions */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* Subtle shadow */
    display: flex; /* For icon alignment */
    align-items: center;
    justify-content: center;
}

.action-button:hover {
    transform: translateY(-2px); /* Slight lift on hover */
    box-shadow: 0 6px 15px rgba(0,0,0,0.15); /* More pronounced shadow */
}

/* Specific button colors (using Tailwind classes in HTML) */
.bg-red-600:hover { background-color: #c0392b; }
.bg-blue-600:hover { background-color: #2980b9; }
.bg-green-600:hover { background-color: #27ae60; }
.bg-purple-600:hover { background-color: #6c3483; }
.bg-orange-600:hover { background-color: #d35400; }
.bg-indigo-600:hover { background-color: #4a235a; }
.bg-teal-600:hover { background-color: #008080; }


/* Result Display Area */
.result {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fcfcfc;
    box-shadow: inset 0 1px 5px rgba(0,0,0,0.05); /* Inner shadow for result area */
    line-height: 1.7; /* Better readability */
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.result p, .result ul, .result .prose {
    margin-bottom: 0.5em; /* Spacing for paragraphs and list items */
}

.result ul {
    list-style-type: disc;
    margin-left: 1.5em;
}

.result hr {
    border: none;
    border-top: 1px dashed #ccc;
    margin: 20px 0;
    transition: border-top-color 0.3s ease;
}

/* AI Generate Button (inside textarea div) */
.ai-button {
    /* Existing Tailwind classes apply */
    z-index: 10;
}

/* Custom Message Box/Modal */
#messageBox, #loadingOverlay {
    display: none; /* Hidden by default */
    background-color: rgba(0, 0, 0, 0.6); /* Darker overlay */
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out; /* Fade in animation */
}

#messageBox > div, #loadingOverlay > div {
    background-color: white;
    padding: 25px 35px;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25); /* Stronger shadow */
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideIn 0.3s ease-out; /* Slide in animation */
}

#loadingOverlay > div {
    background: none; /* Transparent background for loading text */
    box-shadow: none;
}

#loadingOverlay .fa-spinner {
    font-size: 2.5rem; /* Larger spinner */
    color: #3498db; /* Blue spinner */
}

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

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

/* Navigation Bar Styling */
.main-nav {
    /* Existing Tailwind classes apply */
}

.nav-link {
    @apply px-3 py-2 rounded-md transition-colors duration-200 hover:bg-gray-700;
}

.nav-button {
    @apply px-4 py-2 rounded-md transition-colors duration-200;
}

.dropdown-menu {
    /* Existing Tailwind classes apply */
    left: 0; /* Align dropdown to the left of the button */
    top: 100%; /* Position below the button */
}

.dropdown-item {
    @apply block w-full text-left px-4 py-2 text-sm hover:bg-blue-600 hover:text-white cursor-pointer;
}

/* Mobile menu dropdown specific styling */
.mobile-menu-dropdown {
    width: 100%;
}

.dropdown-menu-sub {
    background-color: #eee; /* Lighter background for sub-menu */
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.dropdown-menu-sub .dropdown-item {
    color: #333; /* Darker text for readability */
}
.dropdown-menu-sub .dropdown-item:hover {
    background-color: #dcdcdc; /* Lighter hover for sub-menu */
}

/* Progress Bar Styles */
.progress-bar-container {
    height: 10px; /* Adjust height as needed */
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden; /* Ensures the fill stays within bounds */
}

.progress-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease-in-out; /* Smooth animation for width changes */
}


/* Responsive adjustments */
@media (min-width: 600px) {
    .form-group {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 2 columns on larger screens */
    }
    .form-group .col-span-full {
        grid-column: span 2 / span 2; /* Ensure full width elements span both columns */
    }
    .button-group {
        flex-direction: row; /* Buttons side-by-side on larger screens */
    }
}

/* Print specific styles (optional but good practice) */
@media print {
    body {
        background-color: #fff;
        padding: 0;
    }
    .container {
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
    }
    form, .button-group, #messageBox, #loadingOverlay, .main-nav, #matchJobDescriptionSection {
        display: none; /* Hide navigation bar and job matching when printing */
    }
    .result {
        border: none;
        box-shadow: none;
        margin-top: 0;
        padding: 0;
    }
    /* Ensure all text is black for printing */
    h1, h2, h3, h4, p, strong {
        color: #000 !important;
    }
}