/* Custom styles for MYDAS ENERGY website */

/* Performance optimizations */
* {
    box-sizing: border-box;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Optimize font loading performance */
* {
    font-display: swap;
}

/* Optimize images */
img {
    max-width: 100%;
    height: auto;
}

/* Critical above-the-fold styles */
.hero-section {
    contain: layout style paint;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Service cards hover effect */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

/* Gallery hover effects */
.gallery-item {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.05);
}

/* Form focus states */
input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(30, 86, 157, 0.1);
}

/* Mobile menu animation */
#mobile-menu {
    transition: transform 0.3s ease;
}

#mobile-menu.open {
    transform: translateX(0);
}

/* Button hover effects */
.btn-primary {
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }
}

/* Infinite scrolling animation for brands section */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.animate-scroll {
    animation: scroll 30s linear infinite;
}

/* Pause animation on hover */
.animate-scroll:hover {
    animation-play-state: paused;
}

/* SEO and Performance Optimizations */

/* Reduce layout shift */
.hero-section img {
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* Optimize font loading */
.font-bold {
    font-display: swap;
}

/* Improve Core Web Vitals */
.service-card,
.gallery-item {
    will-change: transform;
    backface-visibility: hidden;
}

/* Accessibility improvements */
.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;
}

/* Focus states for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #00b901;
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #00b901;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Django Form Styles */
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: #1e569d;
    box-shadow: 0 0 0 3px rgba(30, 86, 157, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

/* Form labels */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

/* Django Messages Styles */
.message-alert {
    transition: all 0.5s ease-in-out;
}

.message-alert.opacity-0 {
    opacity: 0;
}

.message-alert.opacity-100 {
    opacity: 1;
}

.message-alert.translate-x-full {
    transform: translateX(100%);
}

.message-alert.translate-x-0 {
    transform: translateX(0);
}

/* Message close button */
.message-close {
    transition: color 0.15s ease-in-out;
}

.message-close:hover {
    color: #374151;
}

/* Form validation error styles */
.form-control.border-red-500 {
    border-color: #ef4444;
}

.form-control.border-red-500:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    h1,
    h2,
    h3 {
        page-break-after: avoid;
    }
}