/**
 * StockSmart AI - Complete Stylesheet
 * Copy this ENTIRE file to: stocksmart/css/style.css
 */

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --green-50: #f0fdf4;
    --green-600: #16a34a;
    --green-800: #166534;
    --red-50: #fef2f2;
    --red-200: #fecaca;
    --red-600: #dc2626;
    --orange-50: #fff7ed;
    --orange-200: #fed7aa;
    --orange-600: #ea580c;
    --yellow-50: #fefce8;
    --yellow-400: #facc15;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: #fff;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 { font-size: 3rem; font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }
h2 { font-size: 2.25rem; font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }
a { color: var(--blue-600); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--blue-700); }

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

.grid { display: grid; gap: 1rem; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:col-span-2 { grid-column: span 2; }
}

/* ============================================
   HEADER
   ============================================ */
header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--blue-600);
    color: #fff;
}

.btn-primary:hover {
    background: var(--blue-700);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #fff;
    color: var(--blue-600);
    border: 2px solid var(--blue-600);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.w-full { width: 100%; }

/* ============================================
   CARDS
   ============================================ */
.card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    background: #fff;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border: 1px solid;
}

.alert-error {
    background: var(--red-50);
    border-color: var(--red-200);
    color: #991b1b;
}

.alert-success {
    background: var(--green-50);
    border-color: #86efac;
    color: var(--green-800);
}

/* ============================================
   TABLES
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    background: var(--gray-50);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-green {
    background: #dcfce7;
    color: var(--green-800);
}

.badge-orange {
    background: #fed7aa;
    color: #9a3412;
}

/* ============================================
   GRADIENTS
   ============================================ */
.gradient-blue {
    background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-700) 100%);
}

.gradient-blue-light {
    background: linear-gradient(135deg, var(--blue-50) 0%, #fff 100%);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-900 { color: var(--gray-900); }
.text-blue-600 { color: var(--blue-600); }
.text-green-600 { color: var(--green-600); }
.text-red-600 { color: var(--red-600); }
.text-white { color: #fff; }

.bg-white { background: #fff; }
.bg-gray-50 { background: var(--gray-50); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.p-6 { padding: 1.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }

.min-h-screen { min-height: 100vh; }

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    padding: 8rem 0 5rem;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================================ */

/* Mobile (320px - 767px) */
@media (max-width: 767px) {
    /* Typography */
    h1 { font-size: 2rem !important; line-height: 1.2 !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    
    /* Hero Section */
    .hero, section[style*="padding: 8rem"] {
        padding: 3rem 0 2rem !important;
    }
    
    /* All Grid Layouts to Single Column */
    div[style*="grid-template-columns: repeat(2"],
    div[style*="grid-template-columns: repeat(3"],
    div[style*="grid-template-columns: repeat(4"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Flex to Column */
    div[style*="display: flex"][style*="gap: 1rem"],
    div[style*="display: flex"][style*="gap: 2rem"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    /* Buttons */
    .btn, a[style*="padding: 1rem 2rem"] {
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    /* Cards & Padding */
    .card, div[style*="padding: 2rem"] {
        padding: 1.5rem !important;
    }
    
    section[style*="padding: 5rem"] {
        padding: 3rem 0 !important;
    }
    
    /* Dashboard Preview Cards */
    div[style*="grid-template-columns: 1fr 1fr"] > div {
        padding: 0.75rem !important;
    }
    
    /* Text Sizes */
    p[style*="font-size: 1.25rem"] {
        font-size: 1rem !important;
    }
    
    div[style*="font-size: 3rem"] {
        font-size: 2rem !important;
    }
    
    /* How It Works - Numbers */
    div[style*="width: 64px"][style*="height: 64px"] {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.25rem !important;
    }
    
    /* Pricing Cards */
    div[style*="font-size: 3rem"][style*="font-weight: 700"] {
        font-size: 2.5rem !important;
    }
    
    /* Footer Grid */
    footer div[style*="grid-template-columns: repeat(4"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Icon Sizes */
    svg[width="64"] {
        width: 48px !important;
        height: 48px !important;
    }
    
    /* Feature Icons */
    div[style*="width: 80px"][style*="height: 80px"] {
        width: 64px !important;
        height: 64px !important;
    }
    
    div[style*="width: 80px"] svg {
        width: 32px !important;
        height: 32px !important;
    }
    
    /* Arrows in Flow Diagram - Hide on Mobile */
    section[style*="background: linear-gradient(135deg, #2563eb"] svg[width="32"] {
        display: none !important;
    }
    
    /* Testimonial Stars */
    div[style*="color: #eab308"] {
        font-size: 1rem !important;
    }
    
    /* Max Width Containers */
    div[style*="max-width: 1280px"],
    div[style*="max-width: 72rem"],
    div[style*="max-width: 64rem"],
    div[style*="max-width: 56rem"],
    div[style*="max-width: 48rem"] {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* CTA Button Spacing */
    section[style*="background: linear-gradient"][style*="#2563eb"] a[style*="padding: 1rem 2.5rem"] {
        padding: 0.875rem 2rem !important;
        font-size: 1rem !important;
    }
    
    /* FAQ Details */
    details {
        padding: 1rem !important;
    }
    
    /* Modal Badge "MOST POPULAR" */
    div[style*="position: absolute"][style*="top: -16px"] {
        font-size: 0.75rem !important;
        padding: 3px 12px !important;
    }
}

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    h1 { font-size: 2.5rem !important; }
    h2 { font-size: 2rem !important; }
    
    /* 2-Column Grid on Tablet */
    div[style*="grid-template-columns: repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    div[style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Pricing stays side-by-side */
    section#pricing div[style*="grid-template-columns: repeat(2"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Container Padding */
    .container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.375rem !important; }
    
    /* Even Smaller Buttons */
    a[style*="padding"] {
        padding: 0.625rem 1.25rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Compact Cards */
    div[style*="padding: 2rem"],
    div[style*="padding: 1.5rem"] {
        padding: 1rem !important;
    }
    
    /* Pricing Numbers */
    div[style*="font-size: 3rem"] {
        font-size: 2rem !important;
    }
}

/* Desktop Fine-tuning (1025px+) */
@media (min-width: 1025px) {
    /* Ensure grids stay intact */
    div[style*="grid-template-columns: repeat"] {
        display: grid !important;
    }
}