/*
 * Copyright (c) 2025 Eria Software solutions and services private limited.
 * See LICENSE.md for license details.
 */

/* Modern Electricals - Custom CSS */

/* Root Variables for Consistent Theming - Saffron Color Scheme */
:root {
    --primary-color: #FF8C00;        /* Deep Saffron */
    --primary-light: #FFA500;        /* Light Saffron */
    --primary-dark: #E67E00;         /* Dark Saffron */
    --secondary-color: #FF6B35;      /* Orange Red */
    --secondary-light: #FF8A65;      /* Light Orange */
    --accent-color: #FFD700;         /* Golden Yellow */
    --success-color: #4CAF50;        /* Green for success states */
    --warning-color: #FF9800;        /* Amber for warnings */
    --info-color: #2196F3;          /* Blue for info */
    --light-bg: #FFF8F0;            /* Very light saffron background */
    --dark-text: #2C1810;           /* Dark brown text */
    --muted-text: #8D6E63;          /* Brown muted text */
    --border-color: #FFE0B2;        /* Light saffron border */
    --shadow: 0 0.125rem 0.25rem rgba(255, 140, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(255, 140, 0, 0.25);
    --border-radius: 0.75rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #FF8C00 0%, #FF6B35 100%);
    --gradient-light: linear-gradient(135deg, #FFF8F0 0%, #FFE0B2 100%);
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: #fff;
}

/* Custom Bootstrap Color Classes */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: var(--transition);
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

.text-orange { color: var(--secondary-color) !important; }
.text-brown { color: #8D6E63 !important; }

/* Navigation Styles */
.navbar {
    padding: 1rem 0;
    transition: var(--transition);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 600;
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
    padding-top: 100px;
    background: var(--gradient-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::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="%23FF8C00" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-image img {
    border-radius: var(--border-radius);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.hero-image img:hover {
    transform: scale(1.05) rotate(1deg);
}

/* Page Header */
.page-header {
    padding: 120px 0 60px;
    background: var(--gradient-light);
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0.1;
}

/* Feature Cards */
.feature-card {
    background: white;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    height: 100%;
}

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

/* Category Cards */
.category-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* Product Cards */
.product-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    transition: all 0.4s ease;
    overflow: hidden;
    height: 100%;
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--primary-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover::before {
    opacity: 1;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(255, 140, 0, 0.2);
    border-color: var(--primary-color);
}

.product-image {
    height: 220px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff6b35 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
    animation: electricPulse 2s infinite;
}

.product-info {
    padding: 1.8rem;
    position: relative;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-text);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-price .original-price {
    font-size: 0.9rem;
    color: var(--muted-text);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.product-description {
    color: var(--muted-text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Contact Cards */
.contact-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    height: 100%;
}

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

/* Cart Styles */
.cart-item {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Form Styles */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.25);
}

/* Button Animations */
.btn {
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Loading Spinner */
.spinner-border-primary {
    color: var(--primary-color);
}

/* Success Icon Animation */
.success-icon {
    animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Electrical-specific Animations */
@keyframes electricPulse {
    0%, 100% {
        box-shadow: 0 0 5px var(--primary-color);
    }
    50% {
        box-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-light);
    }
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: scale(1.1) rotate(90deg);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.6;
    }
    75% {
        transform: scale(1.1) rotate(270deg);
        opacity: 0.8;
    }
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transition: var(--transition);
}

.animate-on-scroll.animate {
    opacity: 1;
    animation: fadeInUp 0.8s ease-out;
}

.electric-glow:hover {
    animation: electricPulse 2s infinite;
}

.sparkle-icon {
    animation: sparkle 3s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 80px;
        text-align: center;
    }

    .display-4 {
        font-size: 2rem;
    }

    .category-card,
    .service-card {
        margin-bottom: 1rem;
    }

    .product-card {
        margin-bottom: 1.5rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    /* Mobile electrical effects optimization */
    .electrical-overlay {
        display: none; /* Hide complex animations on mobile */
    }

    .circuit-bg,
    .wire-pattern,
    .electrical-grid {
        background-size: 25px 25px; /* Smaller patterns for mobile */
        opacity: 0.5; /* Reduce intensity on mobile */
    }

    .stat-card {
        padding: 0.8rem;
        margin-bottom: 1rem;
    }

    .electrical-icon::after {
        width: 6px;
        height: 6px;
    }

    .hero-image-container {
        margin-top: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 100px 0 50px;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .feature-card,
    .category-card,
    .contact-card {
        margin-bottom: 1rem;
    }

    /* Mobile-specific improvements */
    .page-header {
        padding: 120px 0 60px;
    }

    .page-header .display-4 {
        font-size: 1.8rem;
    }

    .service-detail {
        padding: 2rem 1rem;
    }

    .d-flex.gap-3 {
        flex-direction: column;
        gap: 1rem !important;
    }

    .d-flex.gap-3 .btn {
        width: 100%;
    }

    /* Product grid mobile optimization */
    .product-card {
        margin-bottom: 1.5rem;
    }

    .product-card .card-body {
        padding: 1rem;
    }

    /* Navigation improvements */
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        text-align: center;
    }

    /* Footer mobile optimization */
    footer .col-md-4,
    footer .col-md-2 {
        text-align: center;
        margin-bottom: 2rem;
    }

    /* Stats section mobile */
    .stats-section .display-4 {
        font-size: 2.5rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }
}

/* Electrical Circuit Background Patterns */
.circuit-bg {
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 140, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        linear-gradient(90deg, transparent 24%, rgba(255, 140, 0, 0.05) 25%, rgba(255, 140, 0, 0.05) 26%, transparent 27%, transparent 74%, rgba(255, 140, 0, 0.05) 75%, rgba(255, 140, 0, 0.05) 76%, transparent 77%),
        linear-gradient(0deg, transparent 24%, rgba(255, 140, 0, 0.05) 25%, rgba(255, 140, 0, 0.05) 26%, transparent 27%, transparent 74%, rgba(255, 140, 0, 0.05) 75%, rgba(255, 140, 0, 0.05) 76%, transparent 77%);
    background-size: 100px 100px, 150px 150px, 50px 50px, 50px 50px;
}

.wire-pattern {
    background-image:
        linear-gradient(45deg, transparent 40%, rgba(255, 140, 0, 0.1) 50%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, rgba(255, 107, 53, 0.1) 50%, transparent 60%);
    background-size: 30px 30px;
}

.electrical-grid {
    background-image:
        linear-gradient(rgba(255, 140, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 140, 0, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Enhanced Page Header with Circuit Pattern */
.page-header {
    padding: 140px 0 80px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255, 140, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        linear-gradient(90deg, transparent 49%, rgba(255, 140, 0, 0.05) 50%, transparent 51%),
        linear-gradient(0deg, transparent 49%, rgba(255, 140, 0, 0.05) 50%, transparent 51%);
    background-size: 200px 200px, 300px 300px, 40px 40px, 40px 40px;
    animation: circuitFlow 20s linear infinite;
}

@keyframes circuitFlow {
    0% { background-position: 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 200px 200px, -300px -300px, 40px 40px, -40px -40px; }
}

/* Electrical Component Icons */
.electrical-icon {
    position: relative;
    display: inline-block;
}

.electrical-icon::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: electricPulse 1.5s infinite;
}

/* Enhanced Service Cards with Electrical Theme */
.service-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 2rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(255, 140, 0, 0.15);
}

/* Hero Image Container with Electrical Overlay */
.hero-image-container {
    position: relative;
    display: inline-block;
}

.electrical-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.circuit-line {
    position: absolute;
    top: 20%;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-color) 50%, transparent 100%);
    animation: electricFlow 3s infinite;
}

.circuit-line::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 30%;
    width: 40%;
    height: 2px;
    background: var(--primary-light);
    transform: translateY(-50%);
    animation: electricPulse 2s infinite;
}

.circuit-node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-color);
    animation: electricPulse 1.5s infinite;
}

.circuit-node:nth-child(2) {
    top: 20%;
    left: 10%;
    animation-delay: 0.5s;
}

.circuit-node:nth-child(3) {
    top: 20%;
    right: 10%;
    animation-delay: 1s;
}

.circuit-node:nth-child(4) {
    bottom: 30%;
    left: 50%;
    animation-delay: 1.5s;
}

@keyframes electricFlow {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

/* Stat Cards */
.stat-card {
    padding: 1rem;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
    border: 1px solid rgba(255, 140, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 140, 0, 0.15);
}

/* Electric Glow Button Effect */
.electric-glow {
    position: relative;
    overflow: hidden;
}

.electric-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.electric-glow:hover::before {
    left: 100%;
}

/* Utility Classes */
.text-decoration-none {
    text-decoration: none !important;
}

.cursor-pointer {
    cursor: pointer;
}

.border-radius {
    border-radius: var(--border-radius);
}

.shadow-custom {
    box-shadow: var(--shadow);
}

.shadow-lg-custom {
    box-shadow: var(--shadow-lg);
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
    }
}
