/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Navigation */
header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 1rem;
}

.hero-features span {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

/* Calculator Section */
.calculator-section {
    padding: 4rem 0;
}

.calculator-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.calculator-card h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.input-group input {
    flex: 1;
}

.input-prefix {
    background: var(--bg-light);
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-weight: 600;
    color: var(--text-light);
}

input[type="number"] {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s;
    width: 100%;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-group input {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.unit-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 1rem;
    background: var(--bg-light);
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}

select.full-width {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--bg-white);
    cursor: pointer;
    transition: all 0.3s;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Shape Selector */
.shape-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.shape-btn {
    padding: 1rem;
    border: 2px solid var(--border-color);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.shape-btn:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.shape-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.shape-icon {
    font-size: 1.5rem;
}

/* Shape Forms */
.shape-form {
    display: none;
}

.shape-form.active {
    display: block;
}

/* Depth Presets */
.depth-presets {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.preset-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    color: var(--text-dark);
}

.preset-btn:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.preset-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Results */
.results {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    border: 2px solid var(--secondary-color);
}

.results.hidden {
    display: none;
}

.results h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-item {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.result-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.result-details {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.result-details h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.result-details ul {
    list-style: none;
    padding-left: 0;
}

.result-details li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.result-details li:last-child {
    border-bottom: none;
}

.result-tip {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-color);
}

.result-tip strong {
    color: var(--accent-color);
}

.result-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem 1.5rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    color: var(--text-dark);
}

.action-btn:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

/* Info Card */
.info-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.info-card h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.recommendation-item {
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--secondary-color);
}

.recommendation-item h4 {
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-size: 1.125rem;
}

.depth-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.depth-note {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Guide Section */
.guide-section {
    padding: 4rem 0;
    background: var(--bg-white);
}

.guide-section h2 {
    font-size: 2.25rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

.guide-grid {
    display: grid;
    gap: 2rem;
}

.guide-card {
    background: var(--bg-light);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.guide-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.guide-card ol, .guide-card ul {
    padding-left: 1.5rem;
}

.guide-card li {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.guide-card strong {
    color: var(--primary-color);
}

.formula-item {
    margin-bottom: 1.5rem;
}

.formula-item h4 {
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.formula-item code {
    display: block;
    background: var(--bg-white);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
    border-left: 4px solid var(--secondary-color);
}

.gravel-types {
    display: grid;
    gap: 1.5rem;
}

.gravel-type-item {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-color);
}

.gravel-type-item h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
}

.faq-section h2 {
    font-size: 2.25rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

.faq-grid {
    display: grid;
    gap: 1.5rem;
}

.faq-item {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.faq-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.faq-item h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.faq-item p {
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.faq-item ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.faq-item li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* Related Section */
.related-section {
    padding: 4rem 0;
    background: var(--bg-white);
}

.related-section h2 {
    font-size: 2.25rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.related-card {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    border: 2px solid var(--border-color);
}

.related-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.related-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.related-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Footer */
footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-section p {
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
}

.footer-bottom a:hover {
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-features {
        gap: 1rem;
        font-size: 0.875rem;
    }
    
    .calculator-card {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .shape-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .recommendations-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        gap: 1rem;
        font-size: 0.875rem;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .calculator-card {
        padding: 1rem;
    }
    
    .shape-selector {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    header, footer, .nav-links, .hero, .result-actions, .related-section {
        display: none;
    }
    
    .calculator-card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .results {
        page-break-inside: avoid;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results {
    animation: fadeIn 0.5s ease-out;
}

/* Accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus, input:focus, select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

