@import url('theme.css');

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text-main); line-height: 1.6; padding: 20px; }

/* --- LAYOUT --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- NAVIGATION --- */
.navbar { background: var(--card-bg); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); position: sticky; top: 0; z-index: 100; padding: 1rem 0; }
.nav-container { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.nav-brand { font-size: 1.5rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.nav-links { display: flex; gap: 2rem; }
.nav-link { color: var(--text-main); text-decoration: none; font-weight: 500; transition: color 0.2s; }
.nav-link:hover { color: var(--primary); }

.hero-section { display: flex; align-items: center; min-height: 80vh; padding: 80px 20px; background: linear-gradient(135deg, var(--bg) 0%, #e0f2fe 100%); border-radius: var(--radius); margin-bottom: 40px; }
.hero-content { flex: 1; text-align: center; max-width: 700px; margin: 0 auto; padding: 0 20px; }
.hero-content h1 { font-size: 3rem; margin-bottom: 20px; color: var(--text-main); line-height: 1.2; padding: 0 10px; text-shadow: 2px 2px 4px rgba(0,0,0,0.1); }
.hero-content .hero-subtitle { color: var(--text-muted); font-size: 1.3rem; margin-bottom: 30px; line-height: 1.6; padding: 0 10px; }
.hero-buttons { display: flex; gap: 20px; justify-content: center; margin-bottom: 40px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; padding: 0 20px; }
.stat-item { text-align: center; }
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--primary); display: block; }
.stat-label { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; margin-top: 5px; }

h1 { font-size: 2.5rem; margin-bottom: 16px; color: var(--text-main); text-align: center; text-shadow: 2px 2px 4px rgba(0,0,0,0.1); }
.hero-subtitle { color: var(--text-muted); font-size: 1.2rem; max-width: 600px; margin: 0 auto; line-height: 1.6; }
.subtitle { color: var(--text-muted); font-size: 0.95rem; text-align: center; }

/* --- BUTTONS --- */
.btn { display: inline-block; padding: 12px 24px; border-radius: var(--radius); font-size: 1rem; font-weight: 600; text-decoration: none; transition: all 0.2s; cursor: pointer; border: none; text-align: center; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
.btn-secondary { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-secondary:hover { background: var(--primary); color: white; transform: translateY(-2px); }
.btn-large { padding: 16px 32px; font-size: 1.1rem; }
.btn-large.btn-secondary { background: white; color: var(--primary); border: 2px solid var(--primary); }
.btn-large.btn-secondary:hover { background: var(--primary); color: white; }

/* --- INTERNAL NAV --- */
.internal-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: var(--card-bg);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.internal-nav::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.internal-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.internal-nav a:hover {
    background: #e0f2fe;
    color: var(--primary);
}

.internal-nav a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* --- AD CONTAINERS --- */
/* --- NEW AD CONTAINER LOGIC (CLS Safe) --- */
.ad-container {
    background: #f1f5f9; 
    border: 1px dashed #cbd5e1; 
    border-radius: var(--radius);
    margin: 30px 0; 
    text-align: center; 
    color: var(--text-muted);
    
    /* Enforce space to prevent layout shift when ad loads */
    min-height: 120px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    overflow: hidden;
}

/* --- SECTIONS --- */
.section-header { text-align: center; margin-bottom: 50px; }
.section-header h2 { font-size: 2.2rem; margin-bottom: 10px; color: var(--text-main); }
.section-header p { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; margin: 0 auto; }

/* --- FEATURES SECTION --- */
.features-section { padding: 80px 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; margin-bottom: 60px; }
.feature-card { background: var(--card-bg); padding: 30px; border-radius: var(--radius); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); border: 1px solid var(--border); text-align: center; transition: transform 0.2s, box-shadow 0.2s; }
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px -1px rgba(0, 0, 0, 0.15); }
.feature-icon { font-size: 3rem; margin-bottom: 20px; }
.feature-card h3 { font-size: 1.3rem; margin-bottom: 15px; color: var(--text-main); }
.feature-card p { color: var(--text-muted); line-height: 1.6; }

/* --- TOOLS SECTION --- */
.tools-section { padding: 80px 0; background: #f8fafc; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; margin-bottom: 60px; }
.tool-card { background: var(--card-bg); padding: 40px; border-radius: var(--radius); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); border: 1px solid var(--border); transition: transform 0.2s, box-shadow 0.2s; text-align: center; }
.tool-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px -1px rgba(0, 0, 0, 0.15); }
.tool-icon { font-size: 3rem; margin-bottom: 20px; }
.tool-card h3 { font-size: 1.5rem; margin-bottom: 15px; color: var(--text-main); }
.tool-card p { color: var(--text-muted); line-height: 1.6; margin-bottom: 25px; }

/* --- TESTIMONIALS SECTION --- */
.testimonials-section { padding: 80px 0; }
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; margin-bottom: 60px; }
.testimonial-card { background: var(--card-bg); padding: 30px; border-radius: var(--radius); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); border: 1px solid var(--border); }
.testimonial-content { font-style: italic; margin-bottom: 20px; color: var(--text-main); line-height: 1.6; }
.testimonial-author { }
.author-name { font-weight: 600; color: var(--text-main); }
.author-title { color: var(--text-muted); font-size: 0.9rem; margin-top: 5px; }

/* --- FAQ SECTION --- */
.faq-section { padding: 80px 0; background: #f8fafc; }
.faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 30px; margin-bottom: 60px; }
.faq-item { background: var(--card-bg); padding: 30px; border-radius: var(--radius); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); border: 1px solid var(--border); }
.faq-item h3 { font-size: 1.2rem; margin-bottom: 15px; color: var(--text-main); }
.faq-item p { color: var(--text-muted); line-height: 1.6; }

/* --- CTA SECTION --- */
.cta-section { text-align: center; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%); color: white; padding: 80px 20px; border-radius: var(--radius); margin: 60px 0; }
.cta-content { max-width: 600px; margin: 0 auto; }
.cta-section h2 { font-size: 2.2rem; margin-bottom: 20px; color: white; }
.cta-section p { font-size: 1.2rem; margin-bottom: 30px; opacity: 0.9; }
.cta-buttons { display: flex; gap: 20px; justify-content: center; }

/* --- TOOL CARD --- */
.tool-card { background: var(--card-bg); padding: 25px; border-radius: var(--radius); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); border: 1px solid var(--border); transition: transform 0.2s, box-shadow 0.2s; width: 100%; max-width: 700px; margin: 0 auto 40px auto; }
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 8px 12px -1px rgba(0, 0, 0, 0.15); }
.tool-card h2 { font-size: 1.4rem; margin-bottom: 12px; color: var(--primary); }
.tool-card p { margin-bottom: 20px; line-height: 1.6; }

@media (min-width: 768px) {
    .tool-card { width: 100%; max-width: 800px; }
}

/* --- TOOL-SPECIFIC STYLES --- */
/* CTC Calculator Tool */
.tool-card.ctc-calculator { border-left: 4px solid var(--success); }
.tool-card.ctc-calculator h2 { color: var(--success); }

/* Salary Estimator Tool */
.tool-card.salary-estimator { border-left: 4px solid var(--primary); }
.tool-card.salary-estimator h2 { color: var(--primary); }

/* Resume Score Tool */
.tool-card.resume-score { border-left: 4px solid var(--danger); }
.tool-card.resume-score h2 { color: var(--danger); }

.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.9rem; }

.input-wrapper { position: relative; }
.currency-symbol { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.percent-symbol { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
input[type="number"] { width: 100%; padding: 12px 12px 12px 30px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; outline: none; transition: border-color 0.2s; }
input[type="number"]:focus { border-color: var(--primary); }
select { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; outline: none; transition: border-color 0.2s; background: white; }
select:focus { border-color: var(--primary); }

.radio-group { display: flex; gap: 15px; }
.radio-label { display: flex; align-items: center; cursor: pointer; font-size: 0.9rem; }
.radio-label input { margin-right: 6px; }

button.calculate-btn { width: 100%; background: var(--primary); color: white; border: none; padding: 14px; border-radius: var(--radius); font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
button.calculate-btn:hover { background: var(--primary-hover); }

/* --- RESULTS SECTION --- */
.result-box { display: none; margin-top: 25px; padding-top: 25px; border-top: 1px solid var(--border); animation: fadeIn 0.3s ease-in; position: relative; }
.result-box::before { content: ""; font-size: 2rem; position: absolute; top: -15px; left: 50%; transform: translateX(-50%); background: white; padding: 0 10px; }
.highlight-value { font-size: 2rem; font-weight: 700; color: var(--success); text-align: center; margin: 10px 0; position: relative; }
.highlight-value::after { content: ""; font-size: 1.5rem; margin-left: 10px; animation: bounce 1s ease-in-out; }
.disclaimer { font-size: 0.75rem; color: var(--text-muted); text-align: center; margin-top: 15px; font-style: italic; }

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* --- CSS PIE CHART --- */
.chart-container {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
    align-items: center;
    justify-content: center; /* Center items when wrapped */
    margin: 30px 0;
    gap: 40px; /* Increased gap between chart and legend */
}
.pie-chart {
    width: 100%; /* Take full width of parent */
    max-width: 200px; /* Increased size for better visibility */
    aspect-ratio: 1 / 1; /* Maintain square aspect ratio */
    border-radius: 50%;
    background: conic-gradient(var(--success) 0deg 270deg, var(--danger) 270deg 360deg); /* Dynamic via JS */
    position: relative;
    flex-shrink: 0; /* Prevent shrinking below content size */
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.pie-chart:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}
.pie-chart::before {
    content: "";
    font-size: 1.5rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* Tooltip for pie chart sections */
.pie-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    white-space: nowrap;
}
.pie-tooltip.show {
    opacity: 1;
}

.chart-legend, .chart-legend-detailed {
    font-size: 0.9rem; /* Slightly larger font */
    margin-top: 10px;
}
.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px; /* Increased spacing */
    padding: 4px 0;
    transition: opacity 0.3s ease;
}
.legend-item:hover {
    opacity: 0.8;
}
.dot {
    width: 12px; /* Slightly larger dots */
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px; /* More spacing */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* --- CONTENT --- */
.content-section {
    margin-top: 40px;
    padding: 30px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
}

.content-section h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--primary);
}

.content-section p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.content-section ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.content-section li {
    margin-bottom: 8px;
}

/* --- FOOTER STYLES --- */
.footer {
    margin-top: 60px;
    border-top: 1px solid var(--border);
    padding: 40px 0;
    background: white;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-section h4 {
    color: var(--text-main);
    margin-bottom: 15px;
    font-size: 1rem;
}

.footer-section p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: var(--primary);
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    .container { padding: 0 15px; }
    body { padding: 10px; }

    /* Navigation */
    .nav-container { flex-direction: column; gap: 1rem; }
    .nav-links { gap: 1rem; }

    /* Hero Section */
    .hero-section { flex-direction: column; text-align: center; min-height: auto; padding: 40px 0; }
    .hero-content h1 { font-size: 2.2rem; }
    .hero-content .hero-subtitle { font-size: 1.1rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .hero-stats { gap: 20px; }

    /* Sections */
    .section-header h2 { font-size: 1.8rem; }
    .features-grid, .tools-grid, .testimonials-grid, .faq-grid { grid-template-columns: 1fr; gap: 30px; }
    .feature-card, .tool-card, .testimonial-card, .faq-item { padding: 25px; }

    /* CTA Section */
    .cta-section h2 { font-size: 1.8rem; }
    .cta-buttons { flex-direction: column; align-items: center; }

    /* Footer */
    .footer-content { grid-template-columns: 1fr; gap: 30px; text-align: center; }
}

/* --- PERFORMANCE OPTIMIZATIONS --- */
* { box-sizing: border-box; }
img { max-width: 100%; height: auto; }
button, .btn { -webkit-tap-highlight-color: transparent; }

/* --- ACCESSIBILITY --- */
.btn:focus, button:focus, input:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
/* --- TOOL 2 SPECIFIC: RANGE VISUALIZER --- */
.range-container {
    margin-top: 30px;
    position: relative;
    padding-bottom: 20px;
}

.range-bar-bg {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.range-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
    width: 0%; /* Animated via JS */
    transition: width 1s ease-out;
    border-radius: 10px;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.median-marker {
    position: absolute;
    top: -25px;
    left: 50%; /* Dynamic */
    transform: translateX(-50%);
    background: var(--text-main);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    opacity: 0; /* Hidden initially */
    transition: opacity 0.5s;
}
.median-marker::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: var(--text-main) transparent transparent transparent;
}
/* --- TOOL 3: RESUME SCORER --- */
textarea.resume-input {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: monospace; /* Helps user edit alignment */
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.2s;
}
textarea.resume-input:focus {
    border-color: var(--primary);
    outline: none;
}

.score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--border) 0% 100%); /* Default gray */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 10px;
    transition: background 1s ease-out;
}

.score-inner {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.score-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.checklist {
    text-align: left;
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.check-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.icon {
    margin-right: 10px;
    font-size: 1.1rem;
    min-width: 20px;
}

.icon.pass { color: var(--success); }
.icon.fail { color: var(--danger); }
.icon.warn { color: #f59e0b; }