/* Unit Converter - Main Stylesheet */
/* Color Scheme: Dark theme with blue/indigo accent - matching app */

:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --secondary: #6366F1;
    --accent: #22D3EE;
    --bg: #0D0D0D;
    --bg-secondary: #111111;
    --card: #161616;
    --card-hover: #1A1A1A;
    --text: #FFFFFF;
    --text-muted: #9CA3AF;
    --text-light: #6B7280;
    --border: #262626;
    --success: #10B981;
    --warning: #F59E0B;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
header {
    background: #0D0D0D;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

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

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

.logo-icon {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
}

.logo:hover .logo-icon {
    transform: rotate(180deg);
}

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

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: white;
}

.nav-app-btn {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.nav-app-btn:hover {
    background: var(--card);
    color: var(--text);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: 0.3s;
}

/* Mobile Navigation */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.show {
    display: block;
    opacity: 1;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--card);
    z-index: 2000;
    padding: 2rem;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px var(--shadow-lg);
}

.mobile-nav.open {
    right: 0;
}

.mobile-nav-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text);
    cursor: pointer;
}

.mobile-nav ul {
    list-style: none;
    margin-top: 3rem;
}

.mobile-nav ul li {
    margin-bottom: 1.5rem;
}

.mobile-nav ul li a {
    color: var(--text);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    transition: color 0.3s;
}

.mobile-nav ul li a:hover {
    color: var(--primary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
    font-weight: 600;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Search Box */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-box {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--card);
    color: var(--text);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

/* ============================================
   APP DOWNLOAD BANNER
   ============================================ */
.app-download-banner {
    display: none;
}

.app-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 12px;
    padding: 8px;
}

.app-icon svg {
    width: 100%;
    height: 100%;
}

.app-text h3 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.app-text p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.play-store-btn {
    transition: transform 0.3s;
}

.play-store-btn:hover {
    transform: scale(1.05);
}

.play-store-btn img {
    height: 48px;
    width: auto;
}

/* ============================================
   CONVERTER CATEGORIES
   ============================================ */
.categories-section {
    margin: 3rem 0;
}

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

.category-group {
    margin-bottom: 2.5rem;
}

.category-title {
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.converter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.converter-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.converter-card:hover {
    background: var(--card-hover);
    border-color: #333;
}

.converter-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    opacity: 0.9;
}

.converter-info h4 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.converter-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.converter-info .converter-fact {
    font-size: 0.8rem;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* ============================================
   POPULAR CONVERTERS
   ============================================ */
.popular-section {
    margin: 3rem 0;
    text-align: center;
}

.popular-section h2 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.popular-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.popular-item {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: all 0.3s;
}

.popular-item:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features-section {
    margin: 4rem 0;
    text-align: center;
}

.features-section h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--card);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 10px var(--shadow);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

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

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ============================================
   BLOG SECTION
   ============================================ */
.blog-section {
    margin: 4rem 0;
    text-align: center;
}

.blog-section h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 2rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.blog-card {
    background: var(--card);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text);
    text-align: left;
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.3s;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-lg);
}

.blog-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.blog-card h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.blog-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.view-all-btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.view-all-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ============================================
   APP CTA SECTION
   ============================================ */
.app-cta-section {
    display: none;
}

.app-cta-section h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: white;
}

.app-cta-section > p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.app-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 2rem;
    list-style: none;
    margin-bottom: 2rem;
}

.app-features li {
    position: relative;
    padding-left: 1.5rem;
}

.app-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.download-btn {
    display: inline-block;
    transition: transform 0.3s;
}

.download-btn:hover {
    transform: scale(1.05);
}

.download-btn img {
    height: 60px;
    width: auto;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: #0D0D0D;
    color: white;
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
}

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

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

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

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

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

.footer-app-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* ============================================
   CONVERTER PAGE STYLES
   ============================================ */
.breadcrumb {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.page-title {
    font-size: 2.2rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Converter Tool Box */
.converter-tool {
    background: var(--card);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px var(--shadow);
}

.converter-box {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.input-group label {
    font-weight: 500;
    color: var(--text);
}

.input-group select,
.input-group input {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.3s;
}

.input-group select:focus,
.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.swap-btn {
    background: var(--secondary);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s;
    flex-shrink: 0;
}

.swap-btn:hover {
    background: #ff5252;
    transform: rotate(180deg);
}

.convert-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.convert-btn:hover {
    background: var(--primary-dark);
}

.copy-btn {
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Content Sections */
.content-section {
    background: var(--card);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px var(--shadow);
}

.content-section h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.content-section h3 {
    color: var(--text);
    margin: 1.5rem 0 0.75rem;
    font-size: 1.2rem;
}

.content-section p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.content-section ul,
.content-section ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: var(--text-muted);
}

.content-section li {
    margin-bottom: 0.5rem;
}

.content-section strong {
    color: var(--text);
}

/* Tables */
.content-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.content-section th,
.content-section td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.content-section th {
    background: var(--bg);
    color: var(--text);
    font-weight: 600;
}

.content-section td {
    color: var(--text-muted);
}

/* FAQ Items */
.faq-item {
    margin: 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

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

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

.faq-item p {
    color: var(--text-muted);
    margin: 0;
}

/* Related Converters */
.related-converters {
    margin: 2rem 0;
}

.related-converters h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

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

.related-grid a {
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    text-align: center;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.related-grid a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Page App CTA */
.page-app-cta {
    display: none;
}

.page-app-cta h2 {
    color: white;
    margin-bottom: 0.5rem;
}

.page-app-cta p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
}

.page-app-cta ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.5rem;
}

.page-app-cta li {
    color: white;
}

/* ============================================
   BLOG PAGE STYLES
   ============================================ */
.blog-content {
    background: var(--card);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px var(--shadow);
}

.blog-content h1 {
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 1rem;
}

.blog-meta {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.blog-content h2 {
    color: var(--primary);
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.blog-content h3 {
    color: var(--text);
    margin: 1.5rem 0 0.75rem;
    font-size: 1.2rem;
}

.blog-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.blog-content ul,
.blog-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: var(--text-muted);
}

.blog-content li {
    margin-bottom: 0.5rem;
}

.blog-content code {
    background: var(--bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    color: var(--primary);
}

.blog-content pre {
    background: var(--text);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.blog-content pre code {
    background: none;
    padding: 0;
    color: white;
}

.blog-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   CALCULATOR SPECIFIC STYLES
   ============================================ */
.calculator-form {
    background: var(--card);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px var(--shadow);
}

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

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.result-box {
    background: var(--bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: center;
}

.result-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

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

.result-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.calculate-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.calculate-btn:hover {
    background: var(--primary-dark);
}

/* BMI Categories */
.bmi-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.bmi-category {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.bmi-category.underweight {
    background: #dbeafe;
    color: #1e40af;
}

.bmi-category.normal {
    background: #d1fae5;
    color: #065f46;
}

.bmi-category.overweight {
    background: #fef3c7;
    color: #92400e;
}

.bmi-category.obese {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    .nav-links,
    .nav-app-btn {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    main {
        padding: 1rem;
    }

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

    .hero-description {
        font-size: 1rem;
    }

    .app-download-banner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .app-info {
        flex-direction: column;
    }

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

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

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

    .app-features {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

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

    .converter-box {
        flex-direction: column;
    }

    .input-group {
        width: 100%;
    }

    .swap-btn {
        transform: rotate(90deg);
    }

    .swap-btn:hover {
        transform: rotate(270deg);
    }
}

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

    .logo span {
        font-size: 1.2rem;
    }

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

    .popular-grid {
        flex-direction: column;
    }

    .popular-item {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary);
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
    display: none !important;
}

/* Print Styles */
@media print {
    header,
    .app-download-banner,
    .app-cta-section,
    .page-app-cta,
    footer {
        display: none;
    }

    body {
        background: white;
    }

    .converter-tool,
    .content-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
