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

:root {
    --primary-color: #0066CC;
    --primary-dark: #0052A3;
    --secondary-color: #FF6B6B;
    --success-color: #28a745;
    --text-dark: #2C3E50;
    --text-light: #6C757D;
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --border-color: #DEE2E6;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
}

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

/* Header */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.2s;
}

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

.cta-link {
    background: var(--primary-color);
    color: white !important;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.cta-link:hover {
    background: var(--primary-dark);
}

/* Banners */
.banner {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 16px 0;
    text-align: center;
}

.banner-top {
    margin-bottom: 40px;
}

.banner-bottom {
    margin-top: 60px;
}

.banner-text {
    font-size: 16px;
    margin: 0;
}

.banner-link {
    color: white;
    text-decoration: underline;
    font-weight: 600;
    transition: opacity 0.2s;
}

.banner-link:hover {
    opacity: 0.85;
}

/* Main Content */
.main {
    padding: 40px 0;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 48px;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* Calculator Card */
.calculator-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px;
    margin-bottom: 40px;
}

.card-header {
    text-align: center;
    margin-bottom: 32px;
}

.card-header h2 {
    font-size: 28px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.card-subtitle {
    color: var(--text-light);
    font-size: 14px;
}

/* Form */
.calculator-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 16px;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: border-color 0.2s;
}

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

.form-group small {
    margin-top: 6px;
    color: var(--text-light);
    font-size: 13px;
}

.btn-calculate {
    width: 100%;
    padding: 16px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-calculate:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-calculate:active {
    transform: translateY(0);
}

/* Results */
.results {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.results.hidden {
    display: none;
}

.results-title {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 24px;
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.result-item {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item.primary {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    border: 2px solid var(--primary-color);
}

.result-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.result-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.result-item.primary .result-value {
    color: var(--primary-color);
}

/* Mohr Circle Canvas */
.circle-mohr-container {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

#mohrCircle {
    max-width: 100%;
    height: auto;
}

/* Educational Section */
.educational-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px;
    margin-bottom: 40px;
}

.educational-section h2 {
    font-size: 28px;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.educational-section p {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.8;
}

.educational-section ul {
    margin: 16px 0 16px 24px;
}

.educational-section li {
    margin-bottom: 8px;
    color: var(--text-dark);
}

/* CTA Box */
.cta-box {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border-left: 4px solid #FF9800;
    padding: 24px;
    border-radius: var(--radius-md);
    margin-top: 32px;
}

.cta-box h3 {
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.cta-box p {
    margin-bottom: 16px;
}

.btn-cta {
    display: inline-block;
    padding: 12px 28px;
    background: #FF9800;
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.2s;
}

.btn-cta:hover {
    background: #F57C00;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Formulas Section */
.formulas-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px;
}

.formulas-section h2 {
    font-size: 28px;
    color: var(--text-dark);
    margin-bottom: 24px;
}

.formula-box {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border-left: 4px solid var(--primary-color);
}

.formula-box p {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.formula-box code {
    display: block;
    background: white;
    padding: 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-dark);
    overflow-x: auto;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 16px;
    color: white;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.footer-section a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: 8px;
    font-size: 14px;
    transition: color 0.2s;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .calculator-card {
        padding: 24px;
    }

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

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

    .nav {
        gap: 12px;
    }

    .nav-link {
        font-size: 14px;
    }

    .educational-section,
    .formulas-section {
        padding: 24px;
    }

    #mohrCircle {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .logo-text {
        display: none;
    }

    .banner-text {
        font-size: 14px;
    }

    .hero-title {
        font-size: 26px;
    }
}
