/* Green Saver Solar - Custom Styles */

/* CSS Variables for Consistent Theming */
:root {
    --green-primary: #059669; /* emerald-600 */
    --green-secondary: #10b981; /* emerald-500 */
    --green-light: #34d399; /* emerald-400 */
    --green-dark: #047857; /* emerald-700 */
    --blue-primary: #0d9488; /* teal-600 */
    --blue-light: #14b8a6; /* teal-500 */
    --eco-gray: #f8fafc; /* slate-50 */
    --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);
}

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

html {
    scroll-behavior: smooth;
}

body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--green-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--green-dark);
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

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

/* Navigation Enhancements */
.nav-link {
    position: relative;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background-color: var(--green-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Navbar scroll effect */
.navbar-scrolled {
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--green-primary), var(--green-secondary));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--green-dark), var(--green-primary));
}

.btn-secondary {
    background: transparent;
    color: var(--green-primary);
    border: 2px solid var(--green-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--green-primary);
    color: white;
    transform: translateY(-2px);
}

/* Hero Section Enhancements */
.hero-gradient {
    background: linear-gradient(135deg, 
        rgba(66, 165, 245, 0.1) 0%, 
        rgba(129, 199, 132, 0.1) 50%, 
        rgba(248, 249, 250, 1) 100%);
}

/* Animated backgrounds */
.bg-animated-circles {
    position: relative;
    overflow: hidden;
}

.bg-animated-circles::before,
.bg-animated-circles::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-primary), var(--blue-primary));
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.bg-animated-circles::before {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: -3s;
}

.bg-animated-circles::after {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

/* Card Styles */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.card-gradient {
    background: linear-gradient(135deg, 
        rgba(47, 125, 50, 0.05) 0%, 
        rgba(66, 165, 245, 0.05) 100%);
}

/* Icon Animations */
.icon-bounce:hover {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Calculator Styles */
.calc-toggle {
    transition: all 0.3s ease;
    color: #6B7280;
}

.calc-toggle.active {
    background: linear-gradient(135deg, #059669, #0d9488);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.calc-toggle:hover:not(.active) {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

/* Modern Image Overlays */
.image-overlay {
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        transparent 100%
    );
}

/* Enhanced Card Styles */
.solution-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.solution-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Hero Background Enhancements */
.hero-bg-overlay {
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.2) 40%,
        transparent 70%
    );
}

/* Glass Morphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #E5E7EB;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px rgba(47, 125, 50, 0.1);
}

.form-input:invalid {
    border-color: #EF4444;
}

.form-input:valid {
    border-color: var(--green-secondary);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-primary), var(--green-secondary));
    transition: width 0.5s ease;
}

/* Testimonial Cards */
.testimonial-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    position: relative;
    transition: all 0.3s ease;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    color: var(--green-light);
    font-family: serif;
    line-height: 1;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Stats Animation */
.stat-number {
    transition: all 0.5s ease;
}

.stat-number.animate {
    transform: scale(1.1);
    color: var(--green-primary);
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.active {
    max-height: 300px;
}

/* Scroll Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease forwards;
}

/* Chart Container */
.chart-container {
    position: relative;
    width: 100%;
    height: 400px;
}

/* Modal Styles */
.modal-backdrop {
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.modal-content {
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-content.active {
    transform: scale(1);
    opacity: 1;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--green-primary);
    color: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--green-secondary);
}

.notification.error {
    background: #EF4444;
}

.notification.warning {
    background: #F59E0B;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .card {
        margin-bottom: 1.5rem;
    }
    
    .grid-responsive {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }
    
    .print-only {
        display: block;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
.focus-visible {
    outline: 2px solid var(--green-primary);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --green-primary: #1B4D20;
        --green-secondary: #2E7D32;
        --blue-primary: #0D47A1;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .dark-mode-auto {
        background-color: #1a1a1a;
        color: white;
    }
    
    .dark-mode-auto .card {
        background-color: #2a2a2a;
        color: white;
    }
}

/* Custom Gradient Backgrounds */
.gradient-bg-1 {
    background: linear-gradient(135deg, 
        rgba(47, 125, 50, 0.1) 0%, 
        rgba(66, 165, 245, 0.1) 100%);
}

.gradient-bg-2 {
    background: linear-gradient(135deg, 
        rgba(66, 165, 245, 0.1) 0%, 
        rgba(129, 199, 132, 0.1) 100%);
}

.gradient-bg-3 {
    background: linear-gradient(135deg, 
        rgba(129, 199, 132, 0.1) 0%, 
        rgba(248, 249, 250, 1) 100%);
}

/* Text Gradients */
.text-gradient-green {
    background: linear-gradient(135deg, var(--green-primary), var(--green-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-blue {
    background: linear-gradient(135deg, var(--blue-primary), var(--blue-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hover Effects */
.hover-lift:hover {
    transform: translateY(-4px);
    transition: transform 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(47, 125, 50, 0.3);
    transition: box-shadow 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Success States */
.success-animation {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Error States */
.error-shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}