/* 
  GreenRoofGuide.com CSS
  Organized with base styles, components, and utilities
*/

/* Variables */
:root {
    --green-50: #F2FCE2;
    --green-500: #4CAF50;
    --green-600: #3E8E41;
    --green-700: #2E7031;
    --soil-500: #795548;
    --soil-600: #5D4037;
    --gray-50: #F8F9FA;
    --gray-100: #F1F3F5;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-500: #ADB5BD;
    --gray-600: #6C757D;
    --gray-700: #495057;
    --gray-900: #212529;
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--gray-700);
    background-color: var(--gray-50);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900);
    margin-bottom: 0.5em;
}

a {
    text-decoration: none;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

input, button, select {
    font-family: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hidden {
    display: none;
}

/* Header */
.header {
    background-color: var(--green-600);
    color: white;
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.desktop-nav {
    display: none;
}

.desktop-nav a,
.mobile-nav a {
    color: white;
	font-size: 1.2rem;
}

.desktop-nav a:hover,
.mobile-nav a:hover {
    color: #212529;
}

/* Hero */
.hero {
    text-align: center;
    padding: 3rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    color: var(--gray-600);
}

/* Forms & Inputs */
.calculator, .result {
    max-width: 800px;
    margin: 0 auto;
}

.calculator-card, .result-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

input[type="number"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--green-500);
}

/* Buttons */
.btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--green-600);
    color: white;
}

.btn-secondary {
    background: var(--soil-600);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--green-700);
}

.btn:hover {
    opacity: 0.9;
}

.btn-outline:hover {
    background: var(--green-50);
}

.calculate-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #8BC34A 0%, #4CAF50 100%);
    font-size: 1.125rem;
}

/* Roof Type Selector */
.roof-type-selector {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.roof-type-card {
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.roof-type-card:hover {
    background-color: var(--gray-50);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.roof-type-card:focus-visible {
    outline: 2px solid var(--green-600);
    outline-offset: 2px;
}

.roof-type-card.selected[data-type="extensive"] {
    border-color: var(--green-500);
    background-color: var(--green-50);
}

.roof-type-card.selected[data-type="intensive"] {
    border-color: var(--soil-500);
    background-color: #FDF4F1;
}

.roof-type-card .icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.roof-type-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.roof-type-card p {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--gray-600);
}

/* Result Section */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge[data-type="extensive"] {
    background-color: var(--green-50);
    color: var(--green-700);
}

.badge[data-type="intensive"] {
    background-color: #FDF4F1;
    color: var(--soil-600);
}

.estimate-range {
    margin-bottom: 1.5rem;
}

.cost-range {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.estimate {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
}

.to {
    font-size: 1.25rem;
    color: var(--gray-500);
}

.action-buttons {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #E9ECEF;
    background: linear-gradient(to right, #F2FCE2, #FDF4F1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: #495057;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #212529;
}

.modal-body {
    padding: 1rem;
}

/* Fix for modal open body state */
body.modal-open {
    overflow: hidden;
}

.cost-breakdown-section {
    margin: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cost-breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--green-50);
}

.cost-breakdown-item {
    padding: 0.5rem 0;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quality-note {
    margin: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--green-50), #FDF4F1);
    border-radius: 0.75rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.quality-note .icon {
    font-size: 1.5rem;
}

.quality-note-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Benefits Section */
.benefits {
    margin: 4rem auto;
}

.benefits-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.benefit-card {
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--gray-200);
    transition: transform 0.2s, box-shadow 0.2s;
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.benefit-card li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.environmental {
    background-color: var(--green-50);
}

.economic {
    background-color: #FDF4F1;
}

.getting-started {
    background-color: var(--gray-50);
}

/* Footer */
.footer {
    background-color: var(--gray-900);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
    margin-bottom: 2rem;
}

.footer-info p {
    color: var(--gray-500);
    margin-top: 1rem;
    max-width: 400px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}

.link-group h4 {
    margin-bottom: 1rem;
}

.link-group a {
    color: var(--gray-500);
    display: block;
    margin-bottom: 0.5rem;
}

.link-group a:hover {
    color: white;
}

.copyright {
    padding-top: 2rem;
    border-top: 1px solid var(--gray-700);
    text-align: center;
    color: var(--gray-500);
}

/* Mobile Navigation */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    z-index: 1000;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
    display: block;
    background-color: white;
    height: 2px;
    width: 24px;
    transition: transform 0.3s, background-color 0.3s;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
}

.menu-icon::before {
    transform: translateY(-8px);
}

.menu-icon::after {
    transform: translateY(8px);
}

.mobile-menu-btn.active .menu-icon {
    background-color: transparent;
}

.mobile-menu-btn.active .menu-icon::before {
    transform: translateY(0) rotate(45deg);
}

.mobile-menu-btn.active .menu-icon::after {
    transform: translateY(0) rotate(-45deg);
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--gray-900);
    transition: right 0.3s ease;
    z-index: 999;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-content {
    padding: 5rem 1.5rem 1.5rem;
}

.mobile-nav nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-nav a {
    font-size: 1.125rem;
}

/* Error message styling */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    display: none;
}

/* Media Queries - All grouped at the end */
@media (min-width: 640px) {
    .roof-type-selector {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        gap: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .benefits-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
}