/* =================================
   EnergiaSolar Córdoba - Custom Styles
   ================================= */

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

html {
    scroll-behavior: smooth;
}

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

/* Custom Properties (CSS Variables) */
:root {
    --solar-orange: #F9A825;
    --solar-blue: #1A202C;
    --solar-green: #2E7D32;
    --text-gray: #2D3748;
    --bg-light: #F7FAFC;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition-all: all 0.3s ease-in-out;
}

/* Custom 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);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@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);
    }
}

/* Animation Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out;
}

.animate-pulse-slow {
    animation: pulse 3s ease-in-out infinite;
}

.animate-bounce-gentle {
    animation: bounce 2s infinite;
}

/* Custom Gradient Backgrounds */
.gradient-solar {
    background: linear-gradient(135deg, var(--solar-orange) 0%, #FFD54F 100%);
}

.gradient-blue {
    background: linear-gradient(135deg, var(--solar-blue) 0%, #2D3748 100%);
}

.gradient-green {
    background: linear-gradient(135deg, var(--solar-green) 0%, #388E3C 100%);
}

/* Custom Button Styles */
.btn-primary {
    background: var(--solar-orange);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition-all);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: #F57C00;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--solar-green);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition-all);
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #1B5E20;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--solar-orange);
    padding: 12px 24px;
    border: 2px solid var(--solar-orange);
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition-all);
    cursor: pointer;
}

.btn-outline:hover {
    background: var(--solar-orange);
    color: white;
    transform: translateY(-1px);
}

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition-all);
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--solar-orange);
    box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.1);
}

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

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-gray);
}

.form-error {
    color: #E53E3E;
    font-size: 14px;
    margin-top: 4px;
}

.form-success {
    color: var(--solar-green);
    font-size: 14px;
    margin-top: 4px;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Card Components */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-all);
    overflow: hidden;
}

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

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

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--solar-blue);
    margin-bottom: 0.5rem;
}

.card-description {
    color: #718096;
    line-height: 1.6;
}

/* Badge Components */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--solar-orange);
    color: white;
}

.badge-secondary {
    background: var(--solar-green);
    color: white;
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--solar-orange);
    color: var(--solar-orange);
}

/* Navigation Enhancements */
.nav-link {
    position: relative;
    transition: var(--transition-all);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--solar-orange);
    transition: width 0.3s ease;
}

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

/* Hero Section Enhancements */
.hero-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
}

/* Parallax Effect for Hero */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #F57C00;
}

/* Selection Color */
::selection {
    background: var(--solar-orange);
    color: white;
}

::-moz-selection {
    background: var(--solar-orange);
    color: white;
}

/* Focus Styles for Accessibility */
.focus-visible:focus {
    outline: 2px solid var(--solar-orange);
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--solar-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-to-content:focus {
    top: 6px;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
    }
    
    @page {
        margin: 2cm;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .mobile-center {
        text-align: center;
    }
    
    .mobile-full {
        width: 100%;
    }
    
    .mobile-hidden {
        display: none;
    }
    
    .mobile-stack > * {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--text-gray);
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid transparent;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        border-color: white;
    }
}

/* Reduced Motion Support */
@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;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here in the future */
}

/* Custom Utilities */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.backdrop-blur {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Interactive Elements */
.interactive {
    cursor: pointer;
    transition: var(--transition-all);
}

.interactive:hover {
    transform: scale(1.02);
}

.interactive:active {
    transform: scale(0.98);
}

/* Solar Panel Animation */
.solar-panel-glow {
    position: relative;
    overflow: hidden;
}

.solar-panel-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(249, 168, 37, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: rotate(45deg) translateX(-100%);
    }
    50% {
        transform: rotate(45deg) translateX(100%);
    }
    100% {
        transform: rotate(45deg) translateX(100%);
    }
}

/* Energy Flow Animation */
.energy-flow {
    position: relative;
    overflow: hidden;
}

.energy-flow::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(249, 168, 37, 0.3), transparent);
    animation: flow 2s infinite linear;
}

@keyframes flow {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-all);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.whatsapp-float svg {
    width: 30px;
    height: 30px;
    color: white;
}

/* Project Filter Animation */
.project-filter-enter {
    animation: fadeInUp 0.5s ease-out;
}

.project-filter-exit {
    animation: fadeOut 0.3s ease-in;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Blog Card Hover Effects */
.blog-card {
    transition: var(--transition-all);
    transform-origin: center bottom;
}

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

.blog-card:hover .blog-card-image {
    transform: scale(1.05);
}

.blog-card-image {
    transition: transform 0.3s ease;
}

/* Testimonial Styles */
.testimonial {
    position: relative;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

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

/* Statistics Counter Animation */
.stat-counter {
    font-weight: 700;
    color: var(--solar-orange);
}

/* Modal Styles */
.modal-overlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

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

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

/* FAQ Accordion */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-content.open {
    max-height: 200px;
}

.faq-button svg {
    transition: transform 0.3s ease;
}

.faq-button.open svg {
    transform: rotate(180deg);
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: var(--bg-light);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--solar-orange);
    width: 0%;
    transition: width 0.3s ease;
}

/* Notification Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--solar-green);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

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

.toast.error {
    border-left-color: #E53E3E;
}

.toast.warning {
    border-left-color: #D69E2E;
}

/* Lazy Loading Placeholder */
.lazy-loading {
    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;
    }
}

/* Sticky Elements */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--solar-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-all);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--solar-orange);
    transform: translateY(-2px);
}

/* Custom List Styles */
.list-check li {
    position: relative;
    padding-left: 2rem;
}

.list-check li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--solar-green);
    font-weight: bold;
}

.list-arrow li {
    position: relative;
    padding-left: 1.5rem;
}

.list-arrow li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--solar-orange);
    font-weight: bold;
}

/* Section Dividers */
.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--solar-orange), transparent);
    margin: 2rem 0;
}

/* Container Utilities */
.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-auto {
    will-change: auto;
}

/* End of Custom Styles */