/**
 * TheWebCal - Garden Calculator Suite
 * Design System - Fresh, Modern, Garden-Inspired
 */

/* ============================================
   CSS VARIABLES - Garden Theme
   ============================================ */
:root {
    /* Garden Colors */
    --forest: #1B4332;           /* Deep forest green */
    --leaf: #2D6A4F;             /* Rich leaf green */
    --sage: #40916C;             /* Sage green */
    --mint: #52B788;             /* Fresh mint */
    --spring: #74C69D;           /* Spring green */
    --light-green: #95D5B2;      /* Light garden green */
    
    /* Earth Tones */
    --soil: #8B4513;             /* Rich soil brown */
    --clay: #A0522D;             /* Clay brown */
    --sand: #DEB887;             /* Sandy beige */
    
    /* Accent Colors */
    --tomato: #E63946;           /* Ripe tomato red */
    --carrot: #F77F00;           /* Carrot orange */
    --sunshine: #FCBF49;         /* Sunshine yellow */
    --sky: #4CC9F0;              /* Clear sky blue */
    
    /* Neutrals */
    --white: #FFFFFF;
    --cream: #F8F9F5;
    --gray-light: #E8ECE4;
    --gray: #B7B7A4;
    --gray-dark: #6B705C;
    --charcoal: #3E4034;
    
    /* Semantic */
    --primary: var(--leaf);
    --accent: var(--mint);
    --success: var(--spring);
    --warning: var(--carrot);
    --error: var(--tomato);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, sans-serif;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;
    --space-10: 4rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(27, 67, 50, 0.1);
    --shadow-md: 0 4px 6px rgba(27, 67, 50, 0.15);
    --shadow-lg: 0 10px 20px rgba(27, 67, 50, 0.2);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--cream);
    color: var(--charcoal);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.2;
    color: var(--forest);
}

h1 { font-size: 3rem; letter-spacing: -0.02em; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }

p { 
    margin-bottom: var(--space-4); 
    color: var(--gray-dark); 
}

a { 
    color: var(--accent); 
    text-decoration: none; 
    transition: all 0.2s; 
}

a:hover { 
    color: var(--sage); 
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

section {
    padding: var(--space-10) 0;
}

/* ============================================
   HEADER
   ============================================ */
header {
    background: var(--white);
    border-bottom: 2px solid var(--gray-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) 0;
}

.logo {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--forest);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.logo-icon {
    font-size: 2rem;
}

.logo-text span {
    color: var(--mint);
}

nav ul {
    display: flex;
    list-style: none;
    gap: var(--space-5);
    align-items: center;
}

nav a {
    color: var(--gray-dark);
    font-weight: 600;
    font-size: 0.9375rem;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

nav a:hover {
    background: var(--gray-light);
    color: var(--forest);
}

nav a.active {
    color: var(--accent);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--forest) 0%, var(--leaf) 100%);
    color: var(--white);
    padding: var(--space-10) 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '🌱🌿🍅🥕🌻';
    position: absolute;
    font-size: 8rem;
    opacity: 0.05;
    right: -2rem;
    top: 50%;
    transform: translateY(-50%);
    letter-spacing: 2rem;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: rgba(82, 183, 136, 0.2);
    border: 1px solid rgba(82, 183, 136, 0.4);
    color: var(--light-green);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.hero h1 {
    color: var(--white);
    font-size: 3.5rem;
    margin-bottom: var(--space-4);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--light-green);
    margin-bottom: var(--space-6);
    max-width: 700px;
}

.hero-features {
    display: flex;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.9375rem;
    color: var(--light-green);
}

.hero-feature-icon {
    font-size: 1.5rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--mint);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(82, 183, 136, 0.3);
}

.btn-primary:hover {
    background: var(--sage);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(82, 183, 136, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-light);
    color: var(--forest);
}

.btn-outline:hover {
    background: var(--gray-light);
    border-color: var(--gray);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: 1.125rem;
}

/* ============================================
   CALCULATOR GRID
   ============================================ */
.calculators-section {
    background: var(--white);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.section-header h2 {
    margin-bottom: var(--space-3);
}

.section-header p {
    font-size: 1.125rem;
    color: var(--gray-dark);
    max-width: 700px;
    margin: 0 auto;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-6);
}

/* Make card links full height */
.calculator-grid > a {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.calc-card {
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.calc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--mint) 0%, var(--spring) 100%);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.calc-card:hover::before {
    transform: scaleX(1);
}

.calc-card:hover {
    border-color: var(--mint);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.calc-icon {
    font-size: 3.5rem;
    margin-bottom: var(--space-4);
    display: block;
}

.calc-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-3);
    color: var(--forest);
}

.calc-card p {
    color: var(--gray-dark);
    margin-bottom: var(--space-4);
    line-height: 1.7;
}

.calc-features {
    list-style: none;
    margin-bottom: var(--space-5);
    flex-grow: 1;
}

.calc-features li {
    padding: var(--space-2) 0;
    color: var(--gray-dark);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.calc-features li::before {
    content: '✓';
    color: var(--success);
    font-weight: bold;
    font-size: 1.25rem;
}

.calc-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
    transition: gap 0.2s;
}

.calc-link:hover {
    gap: var(--space-3);
}

/* ============================================
   FORMS & INPUTS
   ============================================ */
.form-group {
    margin-bottom: var(--space-5);
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--forest);
    margin-bottom: var(--space-2);
}

input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    color: var(--charcoal);
    transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--mint);
    box-shadow: 0 0 0 4px rgba(82, 183, 136, 0.1);
}

/* ============================================
   CARDS & RESULTS
   ============================================ */
.card {
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.result-card {
    background: linear-gradient(135deg, var(--mint) 0%, var(--spring) 100%);
    color: var(--white);
    padding: var(--space-8) var(--space-6);
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-6);
}

.result-card h3 {
    color: var(--white);
    font-size: 1.25rem;
    margin-bottom: var(--space-3);
    opacity: 0.95;
}

.result-value {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    margin: var(--space-4) 0;
}

.result-detail {
    font-size: 0.9375rem;
    opacity: 0.9;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--forest);
    color: var(--light-green);
    padding: var(--space-10) 0 var(--space-6);
}

.footer-content {
    text-align: center;
}

.footer-content h3 {
    color: var(--white);
    margin-bottom: var(--space-3);
}

.footer-content p {
    color: var(--light-green);
    margin-bottom: var(--space-6);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    flex-wrap: wrap;
    margin-bottom: var(--space-6);
}

.footer-links a {
    color: var(--light-green);
    font-size: 0.9375rem;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--space-6);
    text-align: center;
    color: var(--gray);
    font-size: 0.875rem;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-6 { margin-top: var(--space-6); }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
}

/* ============================================
   CARD HEIGHT FIX - Equal Height Cards
   ============================================ */
.calculator-grid {
    align-items: stretch;
}

.calculator-grid > a {
    display: block;
    height: 100%;
}

.calc-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 420px;
}

.calc-features {
    flex-grow: 1;
}

.calc-link {
    margin-top: auto;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   Added for mobile-friendly experience
   ============================================ */

@media screen and (max-width: 768px) {
    
    /* ============================================
       GLOBAL MOBILE FIXES
       ============================================ */
    
    body {
        font-size: 16px !important;
    }
    
    .container {
        padding: 0 1rem !important;
        max-width: 100% !important;
    }
    
    /* ============================================
       TYPOGRAPHY - Make Text Readable
       ============================================ */
    
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
    }
    
    p, li {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }
    
    /* ============================================
       BUTTONS - Make Tappable
       ============================================ */
    
    .btn,
    button,
    input[type="submit"],
    a.btn {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    .btn-lg {
        padding: 1rem 2rem !important;
        font-size: 1.125rem !important;
    }
    
    /* ============================================
       GRIDS - Stack on Mobile
       ============================================ */
    
    .grid-2,
    .grid-3,
    .calculator-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* ============================================
       CARDS - Better Spacing
       ============================================ */
    
    .card,
    .calc-card {
        padding: 1.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .calc-card {
        min-height: auto !important;
    }
    
    /* ============================================
       FORMS & INPUTS - Touch-Friendly
       ============================================ */
    
    input,
    select,
    textarea {
        font-size: 16px !important;
        padding: 0.875rem !important;
        min-height: 44px !important;
    }
    
    label {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* ============================================
       TABLES - Scroll Horizontally
       ============================================ */
    
    table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
    }
    
    /* ============================================
       HERO SECTION
       ============================================ */
    
    .hero {
        padding: 3rem 0 !important;
    }
    
    .hero h1 {
        font-size: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
    }
    
    .hero-features {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    /* ============================================
       FOOTER - Stack Columns
       ============================================ */
    
    footer > .container > div {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* ============================================
       SPACING - Reduce on Mobile
       ============================================ */
    
    section {
        padding: 2rem 0 !important;
    }
    
    .section-header {
        margin-bottom: 2rem !important;
    }
    
    /* ============================================
       IMAGES - Prevent Overflow
       ============================================ */
    
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* ============================================
       IFRAMES - Google Forms etc
       ============================================ */
    
    iframe {
        max-width: 100% !important;
    }
    
    /* ============================================
       RESULT CARDS
       ============================================ */
    
    .result-value {
        font-size: 2.5rem !important;
    }
    
}

/* ============================================
   SMALL MOBILE (iPhone SE, etc)
   ============================================ */

@media screen and (max-width: 375px) {
    
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
    
    .btn {
        padding: 0.75rem 1rem !important;
        font-size: 0.9375rem !important;
    }
    
    .logo {
        font-size: 1.25rem !important;
    }
    
}

/* ============================================
   TABLET - Medium Screens
   ============================================ */

@media screen and (min-width: 769px) and (max-width: 1024px) {
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .container {
        max-width: 720px !important;
    }
    
}

/* ============================================
   TOUCH DEVICE IMPROVEMENTS
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    
    /* All links/buttons bigger for touch */
    a, button {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover,
    .calc-card:hover {
        transform: none !important;
    }
    
}
