/* Root Variables */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #f8fafc;
    --accent-color: #60a5fa;
    --background-color: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Styles */
header {
    background-color: white;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

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

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 4rem 1rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Converter Styles */
.converter-container {
    max-width: 800px;
    margin: -3rem auto 2rem;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.converter-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.tab-button {
    background-color: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: var(--box-shadow);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.tab-button:hover,
.tab-button:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
    outline: none;
}

.tab-button:active {
    transform: translateY(0);
    box-shadow: var(--box-shadow);
}

.tab-button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.converter-box {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-top: 1rem;
}

.input-group {
    position: relative;
    margin-bottom: 2rem;
}

.input-group input[type="number"] {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--background-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.unit-display {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

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

.result-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-group h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.result-item:hover {
    background-color: #f1f5f9;
}

.result-label {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
}

.result-value {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* Info Section */
.info-section {
    padding: 4rem 1rem;
    background-color: white;
}

.info-section h2 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 2rem;
    font-size: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.info-card {
    padding: 2rem;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

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

.info-card h4 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.info-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Examples Section */
.examples-section {
    padding: 4rem 1rem;
    background-color: var(--secondary-color);
}

.examples-section h2 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 2rem;
    font-size: 2rem;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.example-card {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.example-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.example-card h4 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.example-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* FAQ Section */
.faq-section {
    padding: 4rem 1rem;
    background-color: white;
}

.faq-section h2 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 2rem;
    font-size: 2rem;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.faq-item p {
    color: var(--text-secondary);
}

/* Footer */
footer {
    background-color: var(--text-color);
    color: white;
    padding: 4rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Mobile Optimization */
@media (max-width: 768px) {
    .converter-tabs {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .tab-button {
        padding: 1.2rem;
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        min-height: 3.5rem;
    }

    .input-group input[type="number"] {
        font-size: 16px !important;
        padding: 1.2rem;
        -webkit-appearance: none;
        appearance: none;
        border-radius: var(--border-radius);
    }

    /* Prevent double-tap zoom on iOS */
    * {
        touch-action: manipulation;
    }

    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .info-section,
    .examples-section,
    .faq-section {
        padding: 2rem 1rem;
    }
    
    .info-card,
    .example-card,
    .faq-item {
        padding: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* High-DPI Screen Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}
