:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --accent: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --text: #334155;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #22c55e;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: #ffffff;
}

a {
    text-decoration: none;
}
.container {
    width: 90%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== Header Styles ===== */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
}

.logo-icon {
    color: var(--primary);
}
.logo svg {
    width: 36px;
    height: 36px;
    color: var(--primary);
}

.nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-cta {
    background: var(--primary);
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: transform 0.2s ease;
    margin-left: 1rem;
}

.nav-cta:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    padding: 1rem;
    cursor: pointer;
    background: transparent;
    border: 0;
    z-index: 1001;
}

.hamburger-box {
    width: 30px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-inner {
    width: 100%;
    height: 2px;
    background: var(--dark);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

.hamburger-inner::before,
.hamburger-inner::after {
    content: '';
    width: 100%;
    height: 2px;
    background: inherit;
    position: absolute;
    left: 0;
    transition: transform 0.3s ease;
}

.hamburger-inner::before {
    top: -8px;
}

.hamburger-inner::after {
    top: 8px;
}

/* ===== Hero Section ===== */
.hero {
    padding: 160px 0 80px;
    background: linear-gradient(to bottom right, var(--light) 50%, #ffffff 50%);
    border-bottom: #ebeff5 1px solid;
}

.hero-content {
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    color: var(--dark);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.cta-button {
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid transparent;
    cursor: pointer;
}

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

.cta-button:not(.secondary):hover {
    background: var(--primary-dark);
}

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

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

/* ===== Calculator Categories ===== */
.calculator-categories {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.cards-container1 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card1 {
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    padding: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-0.5rem);
    box-shadow: 0 10px 15px rgba(0,0,0,0.05);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: gap 0.3s;
}

.card-link:hover {
    gap: 1rem;
}

.card-link1 {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    transition: gap 0.3s;
    font-size: 1rem;
    font-weight: bold;
}

.card-link1:hover {
    gap: 1rem;
    color: var(--primary-dark);
}

/* ===== Stats Section ===== */
.stats {
    background: var(--dark);
    color: white;
    padding: 6rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
    text-align: center;
}

.stat h3 {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.stat p {
    color: var(--white);
    font-size: 1.1rem;
}


/* ===== Footer ===== */
.footer {
    background: var(--dark);
    color: #cbd5e0;
}

.footer-top {
    padding: 4rem 0;
    border-bottom: 1px solid #4a5568;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-brand .logo {
    color: white;
}

.footer-text {
    color: var(--white);
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-links a {
    color: #cbd5e0;
    font-size: 1.5rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary);
}

.footer-col h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-col a {
    color: var(--light);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    padding: 2rem 0;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    color: var(--light);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #cbd5e0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

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

/* Solar Battery Calculator Specific Styles */
.calculator-detail {
    padding: 4rem 0;
}

.calculator-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 3rem;
}

.calculator-header {
    text-align: center;
    margin-bottom: 2rem;
}

.calculator-version {
    color: var(--text-light);
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.input-group select {
    margin-top: 0.5rem;
    background: var(--light);
}

.calculator-results {
    background: var(--light);
    padding: 2rem;
    border-radius: 0.5rem;
}

.result-box {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.result-box p {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

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

.result-box span {
    font-weight: 700;
    color: var(--primary);
}

.explanation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 4rem 0;
}

.formula-section {
    background: var(--light);
    padding: 2rem;
    border-radius: 0.5rem;
}

.formula-box {
    background: white;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 0.5rem;
    font-family: monospace;
    font-size: 1.2rem;
}

.note {
    color: var(--text-light);
    font-size: 0.9rem;
}

.theory-section ul {
    list-style: none;
    padding-left: 1rem;
}

.theory-section li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.theory-section li::before {
    content: "•";
    color: var(--primary);
    position: absolute;
    left: 0;
}

/* How to Use Section */
.guide-section {
    background: var(--light);
    padding: 1rem;
    border-radius: 1rem;
    margin: 3rem 0;
}

.guide-section h2 {
    font-size: 1.75rem;
    color: var(--dark);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.guide-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

.guide-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.guide-card ol {
    padding-left: 1.5rem;
    color: var(--text-light);
}

.guide-card li {
    margin-bottom: 0.5rem;
}

/* Enhanced Theory Section */
.theory-section.enhanced {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.theory-cards {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.theory-card {
    padding: 1.5rem;
    background: var(--light);
    border-radius: 0.75rem;
}

.theory-card h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.formula-notes {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-top: 1.5rem;
}

.formula-notes p {
    margin-bottom: 0.75rem;
}

.formula {
    color: var(--primary);
    font-weight: 600;
    display: inline-block;
    margin-top: 0.5rem;
}

/* Formula Section Enhancements */
.formula-section .formula-box {
    background: var(--light);
    border: 1px dashed var(--primary);
}

/* Button Group Styling */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    margin: 0 auto;
    justify-content: center;
}

.cta-button.secondary {
    background: var(--light);
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

/* Calculation Example */
.calculation-example {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-top: 1.5rem;
    border-left: 4px solid var(--accent);
}

.calculation-example h4 {
    color: var(--dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.example-steps {
    color: var(--text-light);
    line-height: 1.6;
}

.example-steps p {
    margin: 0.5rem 0;
}

/* Formula Display Enhancements */
.formula {
    font-family: monospace;
    font-size: 1.1rem;
    background: rgba(37, 99, 235, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* New Calculator Grid Styles */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.calculator-form {
    width: 100%;
    margin: 0 auto 3rem;
    padding-right: 2rem;
    border-right: 2px solid var(--border);
}

/* FAQ Section Styles */
.faq-section {
    margin: 4rem 0;
}

.faq-section h2 {
    font-size: 1.75rem;
    color: var(--dark);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
}

.faq-question {
    padding: 1.5rem;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.faq-question h3 {
    font-size: 1.1rem;
    color: var(--dark);
    margin: 0;
}

.faq-toggle {
    color: var(--primary);
    transition: transform 0.3s;
}

.faq-item.active .faq-toggle {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--light);
}

.faq-item.active .faq-answer {
    padding: 1.5rem;
    max-height: 1000px;
}

.faq-answer p {
    margin-bottom: 1rem;
}

.faq-answer ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.faq-answer li {
    margin-bottom: 0.5rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 4rem;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 1rem;
    }
    .hamburger {
        display: block;
    }
    .nav {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: white;
        padding: 2rem;
        transition: left 0.3s ease;
    }

    .nav.active {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 1.5rem;
    }

    .hero {
        padding: 120px 0 60px;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }

    .cards-container1 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .footer-bottom .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .categories-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        margin-bottom: 3rem;
    }

    .nav-cta {
        background: var(--primary);
        color: white !important;
        padding: 0.75rem 1.5rem;
        border-radius: 0.5rem;
        transition: transform 0.2s ease;
        margin-left: 0rem;
    }

    .explanation-grid {
        grid-template-columns: 1fr;
    }
    
    .result-box {
        grid-template-columns: 1fr;
    }

    .guide-grid {
        grid-template-columns: 1fr;
    }
    
    .theory-cards {
        grid-template-columns: 1fr;
    }
    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .calculator-form {
        padding-right: 0;
        border-right: none;
        border-bottom: 2px solid var(--border);
        padding-bottom: 2rem;
    }
    
    .calculator-results {
        padding: 1rem;
    }
    
    /* Ensure full width for all sections */
    .calculator-card,
    .guide-section,
    .explanation-grid,
    .section-header {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .container {
        width: 100% !important;
        padding: 0 1rem !important;
    }

    .input-group input,
    .input-group select {
        width: 100%;
        max-width: 100%;
    }
    
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

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

    .cta-button {
        justify-content: center;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }
    
    .cta-button {
        width: 100%;
    }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate {
    animation: fadeInUp 0.6s ease forwards;
}