/* ===== GLOBAL STYLES & VARIABLES ===== */
:root {
    /* Light Mode Colors */
    --bg-color: #f8f9fa;
    --sidebar-bg: #ffffff;
    --main-bg: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --primary-color: #007bff;
    --primary-hover-bg: #e7f5ff;
    --cell-bg: #ffffff;
    --cell-hover-border: #007bff;
    --shadow-color: rgba(0, 0, 0, 0.05);
}

body.dark-mode {
    /* Dark Mode Colors (Programmer/IDE Theme) */
    --bg-color: #0d1117; /* GitHub Dark Background */
    --sidebar-bg: #161b22; /* Slightly Lighter Background */
    --main-bg: #161b22;
    --text-color: #c9d1d9; /* Softer White Text */
    --text-muted: #8b949e; /* Muted Grey Text */
    --border-color: #30363d;
    --primary-color: #58a6ff; /* Bright Blue Accent */
    --primary-hover-bg: rgba(88, 166, 255, 0.1); /* Subtle Blue Glow */
    --cell-bg: #21262d;
    --cell-hover-border: #58a6ff;
    --shadow-color: rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 15px;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.page-container {
    display: flex;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR STYLES ===== */
.sidebar {
    width: 220px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.75rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 0 0.75rem;
}

.nav-links {
    list-style: none;
    margin-top: 1.5rem;
}

.nav-links li a, .sidebar-footer a {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-links li a .material-symbols-outlined,
.sidebar-footer a .material-symbols-outlined {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.nav-links li a:hover, .sidebar-footer a:hover {
    background-color: var(--primary-hover-bg);
    color: var(--primary-color);
}

.nav-links li a.active {
    background-color: var(--primary-hover-bg);
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
}

.sidebar-footer .sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease, background-color 0.2s ease;
    margin-bottom: 0.5rem;
}

.sidebar-footer .sidebar-link:hover {
    background-color: var(--primary-hover-bg);
    color: var(--primary-color);
}

.github-icon {
    margin-right: 0.75rem;
    flex-shrink: 0;
    min-width: 20px;
}

/* ===== MAIN CONTENT STYLES ===== */
.main-content {
    flex-grow: 1;
    padding: 1.5rem 2.5rem;
    overflow-y: auto;
    height: 100vh;
}

.main-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-github-link {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.header-github-link:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.header-github-icon {
    width: 24px;
    height: 24px;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0 0.6rem;
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-hover-bg);
}

.search-container .material-symbols-outlined {
    color: var(--text-muted);
}

#search-company {
    width: 100%;
    border: none;
    outline: none;
    padding: 0.6rem 0.5rem;
    background-color: transparent;
    color: var(--text-color);
    font-size: 0.95rem;
}

/* ===== THEME SWITCHER STYLES ===== */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.mode-text {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(20px); }

/* ===== COMPANY SECTION STYLES ===== */
.company-section {
    margin-bottom: 3rem;
}

/* ===== SECTION TITLES (MATCHING ABOUT PAGE) ===== */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.section-title .material-symbols-outlined {
    font-size: 2rem;
    color: var(--primary-color);
}

.company-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    cursor: help;
    transition: transform 0.2s ease, background-color 0.2s ease;
    position: relative;
}

.info-icon .material-symbols-outlined {
    font-size: 16px;
    color: white;
}

.info-icon:hover {
    transform: scale(1.1);
}

.info-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background-color: var(--sidebar-bg);
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    font-size: 0.85rem;
    font-weight: 400;
    white-space: normal;
    width: 280px;
    text-align: left;
    z-index: 100;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.info-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--border-color);
}

.info-icon:hover .info-tooltip {
    visibility: visible;
    opacity: 1;
}

.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
}

.company-cell {
    background-color: var(--cell-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1rem;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.company-cell:hover {
    border-color: var(--cell-hover-border);
    color: var(--primary-color);
}

/* ===== ALL COMPANIES SECTION STYLES ===== */
.all-companies-section {
    margin-bottom: 3rem;
}

.companies-dropdown {
    background-color: var(--cell-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    max-height: 250px;
    overflow-y: auto;
}

.company-item {
    display: block;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

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

.company-item:hover {
    background-color: var(--primary-hover-bg);
    color: var(--primary-color);
}

.no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

/* ===== HOW TO USE SECTION STYLES ===== */
.how-to-use-section {
    margin-bottom: 2rem;
}

.instruction-card {
    background-color: var(--cell-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
}

.instruction-list {
    list-style: none;
    counter-reset: instruction-counter;
    margin: 0;
    padding: 0;
}

.instruction-list > li {
    counter-increment: instruction-counter;
    margin-bottom: 1rem;
    padding-left: 2.5rem;
    position: relative;
    line-height: 1.6;
}

.instruction-list > li:last-child {
    margin-bottom: 0;
}

.instruction-list > li::before {
    content: counter(instruction-counter);
    position: absolute;
    left: 0;
    top: 0;
    background-color: var(--primary-color);
    color: white;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.time-period-list {
    list-style: disc;
    margin-top: 0.5rem;
    margin-left: 1.5rem;
    color: var(--text-muted);
}

.time-period-list li {
    margin-bottom: 0.25rem;
    line-height: 1.5;
}

/* ===== SIDEBAR BUTTON STYLES ===== */
.settings-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--text-muted);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.settings-btn .material-symbols-outlined {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.settings-btn:hover {
    background-color: var(--primary-hover-bg);
    color: var(--primary-color);
}

/* ===== MODAL STYLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: var(--sidebar-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: scale(1);
    transition: transform 0.2s ease-in-out;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.95);
}

.modal-content h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.settings-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.delete-button {
    background: none;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 0.75rem 1rem;
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.2s, color 0.2s;
}

.delete-button .material-symbols-outlined {
    margin-right: 0.75rem;
}

.delete-button:hover {
    background-color: #ef4444;
    color: #ffffff;
}

/* ===== CALL TO ACTION SECTION ===== */
.cta-section {
    margin-top: 4rem;
    margin-bottom: 3rem;
}

.cta-card {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(88, 166, 255, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    color: var(--text-color);
    box-shadow: 0 2px 8px var(--shadow-color);
}

body:not(.dark-mode) .cta-card {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.06) 0%, rgba(0, 123, 255, 0.03) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cta-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.cta-title .material-symbols-outlined {
    font-size: 2rem;
    color: #ef4444;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
}

.cta-text {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-color);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.cta-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--shadow-color);
}

.cta-button.primary {
    background-color: var(--primary-color);
    color: white;
}

.cta-button.primary:hover {
    background-color: #4a8fd9;
}

.cta-button.secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.cta-button.secondary:hover {
    background-color: var(--primary-hover-bg);
}

.button-icon {
    width: 20px;
    height: 20px;
}

.cta-button .material-symbols-outlined {
    font-size: 1.5rem;
}

.cta-subtext {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.cta-subtext .material-symbols-outlined {
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* ===== FOOTER SECTION ===== */
.footer-section {
    margin-top: 4rem;
    margin-bottom: 1rem;
}

.footer-content {
    text-align: center;
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.footer-content p {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.heart-icon {
    color: #ef4444;
    font-size: 1.2rem;
    animation: heartbeat 1.5s ease-in-out infinite;
}

.footer-links {
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.separator {
    margin: 0 0.75rem;
    opacity: 0.5;
}

.star-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.star-notice .material-symbols-outlined {
    font-size: 1rem;
    color: #fbbf24;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .cta-card {
        padding: 2rem 1.5rem;
    }

    .cta-title {
        font-size: 1.5rem;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .cta-button {
        width: 100%;
        justify-content: center;
    }
}