/* Custom Styles for Energywise */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    position: relative;
}

/* Section Positioning */
section {
    position: relative;
    z-index: auto;
    clear: both;
    display: block;
    isolation: isolate; /* Creates new stacking context */
    overflow: visible; /* Allow content to be visible but contained */
}

/* Ensure sections don't overlap */
section::after {
    content: '';
    display: block;
    clear: both;
}

/* Company section needs extra bottom spacing */
#azienda {
    padding-bottom: 120px !important;
}

/* Contact section needs extra top spacing */
#contatti {
    padding-top: 120px !important;
    margin-top: 0;
}

/* Container positioning */
.container {
    position: relative;
    z-index: auto;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Color Gradient for Text */
.text-gradient {
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 50%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation Styles */
#navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-link {
    position: relative;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    transition: width 0.3s ease;
}

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

/* Button Styles */
.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    color: white;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    background: white;
    color: #1f2937;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: #10b981;
    color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.fade-in-delay {
    animation: fadeInUp 0.8s ease-out 0.3s both;
    position: relative;
}

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

/* Feature Card */
.feature-card {
    padding: 32px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    z-index: auto;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    transition: all 0.3s ease;
}

.feature-card:hover .icon-circle {
    transform: scale(1.1) rotate(5deg);
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    z-index: auto;
}

.product-card:hover {
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

/* Patent Card */
.patent-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.patent-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

/* Company Card */
.company-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    z-index: auto;
    isolation: isolate;
}

.company-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Contact Card */
.contact-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: auto;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .product-card {
        padding: 24px;
    }
    
    .company-card {
        padding: 20px;
    }
    
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 2rem !important;
    }
}

/* Scroll animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #10b981, #3b82f6);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #059669, #2563eb);
}

/* Gradient boxes - prevent overlapping */
.bg-gradient-to-br,
.bg-gradient-to-r {
    position: relative;
    z-index: auto;
}

/* Space-y containers */
.space-y-6 {
    position: relative;
    z-index: auto;
    display: flex;
    flex-direction: column;
}

.space-y-6 > * {
    position: relative;
    z-index: auto;
    margin-bottom: 0;
}

/* Grid containers */
.grid {
    position: relative;
    z-index: auto;
}

/* Ensure grid items don't overflow */
.grid > * {
    position: relative;
    min-height: 0;
    min-width: 0;
}

/* Print Styles */
@media print {
    #navbar,
    footer {
        display: none;
    }
    
    .product-card,
    .company-card {
        page-break-inside: avoid;
    }
}