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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    line-height: 1.6;
    color: #333;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    z-index: 1001;
}

.logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color:white;
}

.nav-links {
    position: fixed;
    left: -100%;
    top: 0;
    flex-direction: column;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 280px;
    height: 100vh;
    text-align: left;
    transition: left 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    padding: 80px 0 20px 0;
    gap: 0;
    z-index: 1000;
    overflow-y: auto;
    transform: translateX(0);
}

.nav-links.active {
    left: 0;
}

.nav-links li {
    padding: 0;
}

.nav-links a {
    display: block;
    padding: 15px 30px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid white;
    padding-left: 35px;
}

.hamburger {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    border-radius: 3px;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.menu-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 999;
    pointer-events: none;
    transition: background 0.4s ease;
}

.menu-overlay.active {
    background: rgba(0, 0, 0, 0.7);
    pointer-events: all;
}

/* Page Headers (for inner pages) */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.page-header h1 {
    font-size: 42px;
    margin-bottom: 15px;
}

.page-header p {
    font-size: 18px;
    opacity: 0.95;
}

/* Hero Section (for index.html) */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 20px;
    opacity: 0.95;
    max-width: 800px;
    margin: 0 auto;
}

/* Calculator Section */
.calculator-section {
    max-width: 1200px;
    margin: -50px auto 40px;
    padding: 0 20px;
}

.calculator-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.calc-content {
    padding: 30px;
}

.shape-selection-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.shape-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.shape-btn {
    padding: 12px 8px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    text-align: center;
}

.shape-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.shape-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.shape-visual {
    background: white;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.shape-visual svg {
    max-width: 100%;
    height: 180px;
    display: block;
    margin: 0 auto;
}

.shape-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.shape-info-title {
    font-size: 13px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
}

.shape-info-formula {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

input[type="number"], input[type="text"], input[type="email"], textarea {
    width:100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

input[type="number"]:focus, input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select {
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    background: white;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    min-width: 120px;
}

select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.optional-section {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.optional-title {
    font-size: 13px;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 12px;
    font-style: italic;
}

.cost-inputs {
    display: grid;
    grid-template-columns: 80px 1fr auto 1fr;
    gap: 10px;
    align-items: center;
}

.currency-select {
    min-width: 60px;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 25px 0;
}

.btn {
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-calculate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-clear {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-clear:hover {
    background: #cbd5e0;
}

.results {
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f2ff 100%);
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    display: none;
}

.results.show {
    display: block;
    animation: slideIn 0.4s ease;
}

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

.results-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.result-label {
    font-size: 14px;
    color: #4a5568;
    font-weight: 600;
}

.result-value {
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
}

.result-item.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: -10px -15px 15px -15px;
    padding: 20px 15px;
    border-radius: 8px;
    border-bottom: none;
}

.result-item.primary .result-label, .result-item.primary .result-value {
    color: white;
}
.result-item.primary .result-label { font-size: 15px; }
.result-item.primary .result-value { font-size: 28px; }

.result-item.cost {
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    margin: 15px -15px -10px -15px;
    padding: 20px 15px;
    border-radius: 8px;
}

.result-item.cost .result-label, .result-item.cost .result-value {
    color: white;
}
.result-item.cost .result-value { font-size: 24px; }


/* Content Section */
.content-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

/* Adjust margin for inner pages */
.page-header + .content-section {
    margin: -30px auto 60px;
    max-width: 900px; /* Many inner pages use 900px */
}

.content-box {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.content-box h2 {
    color: #2d3748;
    font-size: 28px;
    margin-bottom: 20px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}
.content-box h2:first-child {
    margin-top: 0;
}

.content-box h3 {
    color: #4a5568;
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.content-box p {
    color: #4a5568;
    font-size: 16px;
    margin-bottom: 15px;
    line-height: 1.8;
}

.content-box ul, .content-box ol {
    margin-left: 25px;
    margin-bottom: 20px;
}

.content-box li {
    color: #4a5568;
    margin-bottom: 10px;
    line-height: 1.7;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 30px;
}
.page-header ~ .content-section .feature-grid {
    grid-template-columns: repeat(2, 1fr); /* For inner pages */
}

.feature-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.feature-card h4 {
    color: #2d3748;
    font-size: 18px;
    margin-bottom: 10px;
}

.feature-card p {
    color: #718096;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* Highlight & Warning Boxes */
.highlight-box {
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.highlight-box p {
    margin: 0;
    color: #2d3748;
    font-weight: 500;
}

.warning-box {
    background: #fff5f5;
    border-left: 4px solid #fc8181;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.warning-box p {
    margin: 0;
    color: #742a2a;
    font-weight: 500;
}

.last-updated {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.last-updated p {
    margin: 0;
    color: #718096;
    font-size: 14px;
}

/* CTA Box */
.cta-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    margin-top: 30px;
}

.cta-box h3 {
    font-size: 28px;
    margin-bottom: 15px;
}

.cta-box p {
    font-size: 16px;
    margin-bottom: 25px;
    opacity: 0.95;
    color: white;
}

.cta-btn {
    display: inline-block;
    background: white;
    color: #667eea;
    padding: 15px 40px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    transition: transform 0.3s ease;
}

.cta-btn:hover {
    transform: translateY(-2px);
}

/* Conversion table */
.conversion-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
}

.conversion-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.conversion-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
}

.conversion-table tr:hover {
    background: #f7fafc;
}

/* Formula item */
.formula-item {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 25px;
    align-items: center;
}

.formula-image {
    text-align: center;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
}

.formula-image svg {
    max-width: 100%;
    height: 150px;
}

.formula-details h3 {
    color: #2d3748;
    font-size: 20px;
    margin-bottom: 10px;
}

.formula-details p {
    color: #4a5568;
    margin-bottom: 8px;
}

.formula-details strong {
    color: #667eea;
}

/* FAQ Section */
.faq-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.faq-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 0;
}

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

.faq-question {
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover {
    color: #667eea;
}

.faq-toggle {
    font-size: 24px;
    color: #667eea;
    transition: transform 0.3s ease, color 0.3s ease;
}

.faq-question.active .faq-toggle {
    color: #764ba2;
    transform: rotate(180deg);
}

.faq-answer {
    color: #4a5568;
    line-height: 1.7;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(-5px);
}

.faq-answer.active {
    max-height: 500px;
    margin-top: 10px;
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    background: #2d3748;
    color: white;
    padding: 40px 20px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 0.7;
}

.copyright {
    color: #a0aec0;
    font-size: 14px;
    margin-top: 20px;
}

/* Toast Notification */
#toastContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    border-left: 4px solid #fc8181;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    color: #fc8181;
    font-weight: bold;
    font-size: 18px;
}

.toast-message {
    color: #2d3748;
    font-size: 14px;
    font-weight: 500;
}

/* Contact Form Elements */
textarea {
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}
.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}
.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 16px; }
    .page-header h1 { font-size: 32px; }
    .shape-selection-row { grid-template-columns: 1fr; }
    
    /* Important feature grid rule for index and others */
    .feature-grid, .page-header ~ .content-section .feature-grid { 
        grid-template-columns: 1fr; 
    }
    
    .cost-inputs { grid-template-columns: 1fr; }
    .content-box { padding: 25px; }
    .button-group { grid-template-columns: 1fr; }
    .conversion-table { font-size: 14px; }
    .conversion-table th, .conversion-table td { padding: 8px; }
    .formula-item { grid-template-columns: 1fr; }
    .nav-links { width: 250px; gap: 15px; font-size: 14px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 24px; }
    .hero p { font-size: 14px; }
    .logo { font-size: 18px; }
    .calc-content { padding: 20px; }
    .content-box { padding: 20px; }
    .shape-btn { font-size: 12px; padding: 10px 6px; }
    .nav-links { width: 220px; }
}

@media (min-width: 769px) {
    #measurementInputs {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    #measurementInputs .form-group {
        margin-bottom: 0;
    }

    .hamburger { display: none; }
    .nav-links {
        position: static;
        flex-direction: row;
        background: transparent;
        width: auto;
        height: auto;
        box-shadow: none;
        padding: 0;
        display: flex;
        align-items: center;
        gap: 5px;
        transform: translateX(0);
    }
    .nav-links li { list-style: none; }
    .nav-links a { padding: 8px 15px; border-left: none; }
    .nav-links a:hover {
        background: rgba(255, 255, 255, 0.15);
        border-left: none;
        padding-left: 15px;
        border-radius: 6px;
    }
    .menu-overlay { display: none !important; }
}
