/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-width: 320px;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: bold;
    text-decoration: none;
    color: white;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 2rem);
    flex-wrap: wrap;
}

.dropdown {
    position: relative;
}

.dropdown-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-btn::after {
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.dropdown-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: min(280px, 90vw);
    max-width: 90vw;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
    overflow: hidden;
}

.dropdown:hover .dropdown-content,
.dropdown.active .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
    word-wrap: break-word;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.nav-links {
    display: flex;
    gap: clamp(0.5rem, 2vw, 1.5rem);
    flex-wrap: wrap;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem clamp(0.5rem, 2vw, 1rem);
    border-radius: 4px;
    transition: background-color 0.3s;
    white-space: nowrap;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.nav-links a:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Main Content */
.main {
    padding: clamp(1rem, 3vw, 2rem) 0;
    min-height: calc(100vh - 200px);
}

.page-title {
    color: #2c3e50;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    text-align: center;
    line-height: 1.3;
}

.intro-text {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    text-align: center;
    max-width: min(800px, 90vw);
    margin-left: auto;
    margin-right: auto;
    color: #555;
    line-height: 1.6;
}

/* Calculator Styles */
.calculator-section {
    background: white;
    padding: clamp(1rem, 3vw, 2rem);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: clamp(2rem, 5vw, 3rem);
    width: 100%;
}

.calculator-title {
    color: #2c3e50;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    text-align: center;
    line-height: 1.3;
}

.calculator-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: clamp(1rem, 3vw, 2rem);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

.input-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.input-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.input-group input,
.input-group select {
    padding: clamp(0.5rem, 2vw, 0.75rem);
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    transition: border-color 0.3s;
    width: 100%;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #3498db;
}

.calculate-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1.5rem, 4vw, 2rem);
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 1rem auto;
    display: block;
    width: fit-content;
    min-width: min(200px, 80vw);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.results {
    background: #f8f9fa;
    padding: clamp(1rem, 3vw, 1.5rem);
    border-radius: 6px;
    border-left: 4px solid #3498db;
    margin-top: 1rem;
    width: 100%;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

.result-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.result-value {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    color: #27ae60;
    font-weight: bold;
    text-align: right;
}

/* Content Sections */
.content-section {
    background: white;
    padding: clamp(1rem, 3vw, 2rem);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    width: 100%;
}

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

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

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

.section-title {
    color: #2c3e50;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
    line-height: 1.3;
}

.lsi-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.keyword-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: 500;
    white-space: nowrap;
}

.related-calculators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: clamp(0.75rem, 2vw, 1rem);
    margin: clamp(1rem, 3vw, 1.5rem) 0;
}

.calculator-card {
    background: #f8f9fa;
    padding: clamp(1rem, 3vw, 1.5rem);
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
    width: 100%;
}

.calculator-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: #3498db;
    text-decoration: none;
    color: #333;
}

.calculator-card h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
}

/* FAQ Styles */
.faq-item {
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
}

.faq-question {
    background: #f8f9fa;
    padding: clamp(0.75rem, 2vw, 1rem);
    cursor: pointer;
    font-weight: 600;
    color: #2c3e50;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.faq-question:hover {
    background: #e9ecef;
}

.faq-answer {
    padding: clamp(0.75rem, 2vw, 1rem);
    background: white;
    display: none;
    border-top: 1px solid #e0e0e0;
    font-size: clamp(0.9rem, 2vw, 1rem);
    line-height: 1.6;
}

.faq-answer.active {
    display: block;
}

.faq-toggle {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    transition: transform 0.3s;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

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

/* Chart Styles */
.chart-container {
    background: white;
    padding: clamp(1rem, 3vw, 2rem);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: clamp(1rem, 3vw, 2rem) 0;
    width: 100%;
    overflow: hidden;
}

.pitch-chart {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.chart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    min-width: 600px;
}

.chart-table th,
.chart-table td {
    padding: clamp(0.5rem, 2vw, 0.75rem);
    text-align: center;
    border: 1px solid #ddd;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.chart-table th {
    background-color: #3498db;
    color: white;
    font-weight: 600;
    white-space: nowrap;
}

.chart-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.chart-table tr:hover {
    background-color: #e3f2fd;
}

/* Footer Styles */
.footer {
    background: #2c3e50;
    color: white;
    padding: clamp(1.5rem, 4vw, 2rem) 0 clamp(1rem, 3vw, 1rem);
    margin-top: clamp(2rem, 5vw, 3rem);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #3498db;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
}

.footer-section p,
.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: block;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: clamp(0.5rem, 2vw, 1rem);
    margin-top: 1rem;
    flex-wrap: wrap;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(35px, 8vw, 40px);
    height: clamp(35px, 8vw, 40px);
    background: #34495e;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
    font-size: clamp(0.8rem, 2vw, 1rem);
}

.social-links a:hover {
    background: #3498db;
}

.footer-bottom {
    text-align: center;
    padding-top: clamp(1rem, 3vw, 2rem);
    border-top: 1px solid #34495e;
    color: #95a5a6;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

/* Call to Action */
.cta-section {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: clamp(1.5rem, 4vw, 2rem);
    border-radius: 10px;
    text-align: center;
    margin: clamp(1.5rem, 4vw, 2rem) 0;
    width: 100%;
}

.cta-title {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.cta-buttons {
    display: flex;
    gap: clamp(0.75rem, 2vw, 1rem);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.cta-btn {
    background: white;
    color: #3498db;
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 3vw, 1.5rem);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: transform 0.2s;
    font-size: clamp(0.9rem, 2vw, 1rem);
    white-space: nowrap;
}

.cta-btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
    color: #2980b9;
}

/* Enhanced Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 clamp(15px, 4vw, 20px);
    }
    
    .calculator-form {
        grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    }
    
    .chart-table {
        min-width: 500px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 1rem;
        background: #2c3e50;
        border-radius: 8px;
        padding: 1rem 0;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .nav-links a {
        padding: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        width: 100%;
        text-align: left;
        display: block;
    }
    
    .dropdown {
        width: 100%;
    }
    
    .dropdown-btn {
        width: 100%;
        text-align: left;
        justify-content: space-between;
        display: flex;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        background: none;
        color: white;
        font-size: 1rem;
    }
    
    .dropdown-btn::after {
        font-size: 0.7rem;
        transition: transform 0.3s;
    }
    
    .dropdown.active .dropdown-btn::after {
        transform: rotate(180deg);
    }
    
    .dropdown-content {
        position: static;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        box-shadow: none;
        background: #34495e;
        display: none;
        border-radius: 0;
        margin-top: 0;
    }
    
    .dropdown.active .dropdown-content {
        display: block;
    }
    
    .dropdown-content a {
        color: white;
        padding: 0.75rem 1rem 0.75rem 2rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        font-size: 0.95rem;
    }
    
    .dropdown-content a:hover {
        background: #2c3e50;
    }
    
    .dropdown-content a:last-child {
        border-bottom: none;
    }
    
    .page-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
    
    .calculator-form {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .related-calculators {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cta-btn {
        text-align: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .result-value {
        text-align: left;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .header {
        padding: 0.75rem 0;
    }
    
    .calculator-section,
    .content-section,
    .chart-container {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .calculate-btn {
        width: 100%;
        min-width: auto;
    }
    
    .chart-table {
        min-width: 400px;
        font-size: 0.8rem;
    }
    
    .chart-table th,
    .chart-table td {
        padding: 0.4rem 0.3rem;
    }
    
    .lsi-keywords {
        justify-content: center;
    }
    
    .keyword-tag {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
}

@media (max-width: 360px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .calculator-section,
    .content-section,
    .chart-container {
        padding: 0.75rem;
    }
    
    .page-title {
        font-size: 1.4rem;
    }
    
    .calculate-btn {
        padding: 0.75rem 1rem;
    }
    
    .nav-menu {
        padding: 0.5rem 0;
    }
    
    .nav-links a,
    .dropdown-btn {
        padding: 0.75rem 1rem;
    }
    
    .dropdown-content a {
        padding: 0.6rem 1rem 0.6rem 1.5rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .calculate-btn:hover,
    .calculator-card:hover,
    .cta-btn:hover,
    .nav-links a:hover,
    .dropdown-btn:hover {
        transform: none;
    }
    
    .calculate-btn:active,
    .calculator-card:active,
    .cta-btn:active {
        transform: scale(0.98);
    }
    
    .dropdown-content {
        position: static;
        transform: none;
        width: 100%;
        max-height: none;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.hidden { display: none; }
.visible { display: block; }

/* Schema.org Microdata Styling */
[itemscope] {
    border: none;
    background: transparent;
}