/* SmartWattFlow Main Stylesheet */
/* Mobile-first, optimized for performance */

/* CSS Custom Properties */
:root {
    --color-primary: #10b981;
    --color-secondary: #06b6d4;
    --color-dark: #1e293b;
    --color-gray-900: #0f172a;
    --color-gray-800: #1e293b;
    --color-gray-700: #334155;
    --color-gray-600: #475569;
    --color-gray-500: #64748b;
    --color-gray-400: #94a3b8;
    --color-gray-300: #cbd5e1;
    --color-gray-200: #e2e8f0;
    --color-gray-100: #f1f5f9;
    --color-gray-50: #f8fafc;
    
    --gradient-primary: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    --gradient-dark: linear-gradient(135deg, var(--color-dark) 0%, var(--color-gray-700) 100%);
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'Fira Code', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
}

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

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

body {
    font-family: var(--font-family-sans);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-gray-800);
    background-color: var(--color-gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select {
    font: inherit;
}

/* Focus styles for accessibility */
:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--color-dark);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--border-radius);
    z-index: 100;
}

.skip-link:focus {
    top: 6px;
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-gray-900);
    margin-bottom: 0.5em;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
}

p {
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    min-height: 44px; /* Touch target size */
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--color-gray-700);
    border: 2px solid var(--color-gray-200);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--color-dark);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    min-height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* Navigation */
.nav {
    display: none;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--color-gray-300);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem;
}

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

.nav-link.active {
    color: white;
}

@media (min-width: 768px) {
    .nav {
        display: block;
    }
}

/* Mobile Menu */
.mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-btn {
    padding: 0.25rem 0.5rem;
    background: none;
    border: 1px solid var(--color-gray-600);
    color: var(--color-gray-300);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover,
.lang-btn.active {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Main Content */
.main {
    padding-top: 80px; /* Account for fixed header */
}

/* Hero Section */
.hero {
    background: var(--gradient-dark);
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

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

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

@media (min-width: 640px) {
    .hero-cta {
        flex-direction: row;
    }
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section-alt {
    background: white;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--color-gray-600);
    max-width: 600px;
    margin: 0 auto;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 2rem;
}

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

@media (min-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-gray-200);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    margin-bottom: 1rem;
}

.card-badge {
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-content {
    flex: 1;
}

.card-description {
    color: var(--color-gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.card-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

.card-features {
    list-style: none;
    margin-bottom: 2rem;
}

.card-features li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-gray-600);
}

.card-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: 700;
}

.card-footer {
    margin-top: auto;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-gray-700);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-gray-200);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input::placeholder {
    color: var(--color-gray-400);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.form-checkbox input {
    margin-top: 0.25rem;
}

/* Newsletter */
.newsletter {
    background: linear-gradient(135deg, #f0fdfa, #ecfdf5);
    padding: 4rem 0;
}

.newsletter-box {
    background: white;
    padding: 3rem;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.newsletter-input {
    flex: 1;
    min-width: 250px;
}

@media (max-width: 640px) {
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-input {
        min-width: auto;
    }
}

/* Blog Grid */
.blog-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.blog-card {
    background: white;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--color-gray-200);
}

.blog-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.blog-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-placeholder {
    width: 100%;
    height: 200px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.blog-content {
    padding: 1.5rem;
}

.blog-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.blog-excerpt {
    color: var(--color-gray-600);
    font-size: 0.9rem;
    line-height: 1.5;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--color-gray-500);
}

/* Footer */
.footer {
    background: var(--color-dark);
    color: white;
    padding: 4rem 0 2rem;
}

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

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--color-gray-300);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover,
.footer-section a:focus {
    color: var(--color-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--color-gray-700);
    color: var(--color-gray-400);
}

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-dark);
    color: white;
    padding: 1rem;
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.cookie-consent.show {
    transform: translateY(0);
}

.cookie-consent-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1;
    min-width: 200px;
}

.cookie-consent-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Calculator Specific Styles */
.calculator-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.calculator-result {
    background: linear-gradient(135deg, #f0fdfa, #ecfdf5);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    margin-top: 2rem;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.result-label {
    color: var(--color-gray-600);
    font-weight: 600;
}

/* Comparison Tables */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-gray-200);
}

.comparison-table th {
    background: var(--color-gray-100);
    font-weight: 600;
    color: var(--color-gray-800);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .cookie-consent,
    .btn {
        display: none !important;
    }
    
    .main {
        padding-top: 0 !important;
    }
    
    * {
        background: white !important;
        color: black !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #000;
        --color-secondary: #000;
        --shadow-md: 0 0 0 2px #000;
    }
    
    .btn-primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .card {
        border: 2px solid #000;
    }
}
