/* ====================== 
   PowerElectric - Enhanced CSS
   Theme: Deep Blue Energy Colors
   ====================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;600;700;900&display=swap');

/* Theme Variables */
:root {
    /* Primary Colors */
    --primary-dark: #001133;
    --primary-blue: #002244;
    --primary-charcoal: #1a2744;
    --primary-light: #2d4a72;

    /* Energy Colors */
    --energy-yellow: #ffd700;
    --energy-amber: #ffb000;
    --energy-red: #ff0000;
    --energy-orange: #ff4500;
    --danger-red: #dc143c;
    --success-green: #28a745;

    /* White and Light Colors */
    --pure-white: #ffffff;
    --light-white: #f8f9fa;
    --soft-white: #e9ecef;
    --blue-white: #f0f4f8;

    /* Gradients */
    --gradient-energy: linear-gradient(135deg, #ffd700 0%, #ffb000 50%, #ff4500 100%);
    --gradient-power: linear-gradient(135deg, #ff0000 0%, #ff4500 50%, #ffd700 100%);
    --gradient-dark: linear-gradient(135deg, #001133 0%, #002244 50%, #1a2744 100%);
    --gradient-dark-r: linear-gradient(-135deg, #001133 0%, #002244 50%, #1a2744 100%);
    --gradient-electric: linear-gradient(60deg, #f2720a 0%, #ffe600 25%, #ff0000 50%, #ff2f00 75%, #001133 100%);
    --gradient-blue-white: linear-gradient(135deg, #f0f4f8 0%, #ffffff 50%, #e9ecef 100%);
    --gradient-dark-blue: linear-gradient(135deg, #001133 0%, #002244 100%);

    /* Background Colors */
    --bg-primary: #001133;
    --bg-secondary: #002244;
    --bg-card: #ffffff;
    --bg-light: #f8f9fa;
    --bg-overlay: rgba(0, 17, 51, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.1);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #ffd700;
    --text-dark: #001133;
    --text-muted: #6c757d;
    --text-energy: #ffb000;
    --text-light: #f8f9fa;

    /* Border & Shadow */
    --border-energy: #ffd700;
    --border-light: #e9ecef;
    --border-dark: #343a40;
    --shadow-energy: 0 0 20px rgba(255, 215, 0, 0.5);
    --shadow-red: 0 0 20px rgba(255, 0, 0, 0.5);
    --shadow-blue: 0 8px 32px rgba(0, 17, 51, 0.3);
    --shadow-light: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --radius-full: 50px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Sarabun", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--gradient-dark-r);
    overflow-x: hidden;
    position: relative;
}

/* Enhanced Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 215, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 0, 0, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255, 69, 0, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 60% 20%, rgba(255, 215, 0, 0.03) 0%, transparent 40%);
    z-index: -1;
    animation: electricPulse 12s ease-in-out infinite;
}

@keyframes electricPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    33% {
        opacity: 0.6;
        transform: scale(1.02);
    }

    66% {
        opacity: 0.4;
        transform: scale(0.98);
    }
}

/* Navigation Styles */
.navbar {
    background: var(--gradient-dark) !important;
    border-bottom: 3px solid var(--energy-yellow);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
    box-shadow: 0 2px 20px rgba(0, 17, 51, 0.5);
}

.navbar-brand {
    font-weight: 900;
    font-size: 1.8rem;
    color: var(--energy-yellow) !important;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.navbar-brand:hover {
    transform: scale(1.05);
    text-shadow: 0 0 15px var(--energy-yellow);
    color: var(--energy-yellow) !important;
}

.navbar-brand i {
    color: var(--energy-red);
    animation: lightning 3s ease-in-out infinite;
    margin-right: var(--spacing-sm);
}

@keyframes lightning {

    0%,
    100% {
        text-shadow: 0 0 5px var(--energy-red);
        transform: rotate(0deg);
    }

    50% {
        text-shadow: 0 0 15px var(--energy-red), 0 0 30px var(--energy-orange);
        transform: rotate(5deg);
    }
}

.nav-link {
    color: var(--text-primary) !important;
    font-weight: 600;
    padding: 12px 20px !important;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
    position: relative;
    margin: 0 5px;
    border: rgba(255, 255, 255, 0.05) solid 2px;
    text-decoration: none;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-energy);
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.nav-link:hover{
    color: var(--text-dark) !important;
    transform: translateY(-2px);
    border: white solid 2px !important;
}

.nav-link:hover::before {
    opacity: 1;
}


/* Search Form */
.search-form {
    display: flex;
    gap: 0;
}

.search-form .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--energy-yellow);
    color: var(--text-primary);
    border-radius: var(--radius-full) 0 0 var(--radius-full);
    padding: 12px 20px;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.search-form .form-control:focus {
    background: var(--bg-card);
    border-color: var(--energy-red);
    box-shadow: var(--shadow-red);
    color: var(--text-dark);
    outline: none;
}

.search-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-form .btn {
    background: var(--gradient-energy);
    border: 2px solid var(--energy-yellow);
    color: var(--text-dark);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    padding: 12px 24px;
    font-weight: 700;
    transition: all var(--transition-normal);
}

.search-form .btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-energy);
    color: var(--text-dark);
}

/* Hero Section */
.hero-section {
    background: var(--gradient-electric);
    background-size: 300% 300%;
    animation: gradientShift 15s ease infinite;
    color: white;
    border: 3px solid var(--pure-white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%),
        radial-gradient(circle at 30% 20%, rgba(255, 215, 0, 0.2) 0%, transparent 50%);
    animation: electricFlow 8s ease-in-out infinite;
}

@keyframes electricFlow {

    0%,
    100% {
        transform: translateX(-200px) rotate(0deg);
        opacity: 0.3;
    }

    50% {
        transform: translateX(200px) rotate(180deg);
        opacity: 0.8;
    }
}

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

.hero-section h1 {
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: var(--spacing-lg);
    line-height: 1.2;
}

.hero-section .lead {
    font-size: clamp(1rem, 3vw, 1.3rem);
    margin-bottom: 2rem;
    font-weight: 400;
}

.btn-energy {
    background: var(--gradient-energy);
    border: none;
    color: var(--text-dark);
    font-weight: 700;
    padding: 15px 40px;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-energy);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
}

.btn-energy::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left var(--transition-slow);
}

.btn-energy:hover::before {
    left: 100%;
}

.btn-energy:hover {
    color: var(--text-dark);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.6);
}

.hero-icon {
    font-size: clamp(4rem, 10vw, 8rem);
    color: var(--energy-yellow);
    text-shadow: 0 0 40px var(--energy-yellow);
    animation: powerPulse 4s ease-in-out infinite;
}

@keyframes powerPulse {

    0%,
    100% {
        transform: scale(1);
        text-shadow: 0 0 40px var(--energy-yellow);
    }

    50% {
        transform: scale(1.15);
        text-shadow:
            0 0 60px var(--energy-yellow),
            0 0 100px var(--energy-red),
            0 0 140px var(--energy-orange);
    }
}

/* Section Titles */
.section-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.section-title h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 100px;
    height: 4px;
    background: var(--gradient-energy);
    transform: translateX(-50%);
    border-radius: var(--radius-sm);
    animation: energyPulse 2s ease-in-out infinite;
}

@keyframes energyPulse {

    0%,
    100% {
        width: 100px;
        opacity: 1;
    }

    50% {
        width: 120px;
        opacity: 0.8;
    }
}

/* Product Cards */
.product-card {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: var(--shadow-card);
    height: 100%;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-energy);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 1;
}

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

.product-card:hover {
    transform: translateY(-15px) scale(1.03);
    border-color: var(--energy-yellow);
    box-shadow: var(--shadow-hover), var(--shadow-energy);
}

.card-img-container {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: var(--gradient-blue-white);
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card:hover .card-img-top {
    transform: scale(1.15) rotate(2deg);
}

.card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: var(--gradient-blue-white);
    color: var(--text-muted);
}

.card-img-placeholder i {
    font-size: 4rem;
    opacity: 0.6;
    color: var(--primary-blue);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 2;
    backdrop-filter: blur(5px);
}

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

.product-overlay .btn {
    background: var(--gradient-energy);
    border: white solid 2px;
    color: var(--text-dark);
    padding: 12px 30px;
    border-radius: var(--radius-full);
    font-weight: 700;
    transition: all var(--transition-normal);
    transform: translateY(20px);
}

.product-card:hover .product-overlay .btn {
    transform: translateY(0);
}

.product-overlay .btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.card-body {
    padding: var(--spacing-lg);
    position: relative;
    z-index: 2;
    background: var(--pure-white);
}

.card-title {
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
    line-height: 1.3;
}

.card-text {
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
}

.product-price {
    color: var(--primary-blue);
    font-weight: 900;
    font-size: 1.3rem;
}

/* Badges */
.badge {
    padding: 8px 15px;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-featured {
    background: var(--gradient-energy);
    color: var(--text-dark);
    animation: badgePulse 2s ease-in-out infinite;
}

.badge-new {
    background: var(--gradient-power);
    color: var(--pure-white);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Category Cards */
.category-card {
    background: var(--gradient-blue-white);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    height: 100%;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-energy);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.category-card:hover::before {
    opacity: 0.08;
}

.category-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--energy-red);
    box-shadow: var(--shadow-hover), var(--shadow-red);
}

.category-card .card-body {
    padding: 2.5rem;
    text-align: center;
    position: relative;
    z-index: 2;
    background: var(--pure-white);
}

.category-icon {
    font-size: 4rem;
    color: var(--primary-blue);
    margin-bottom: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.category-card:hover .category-icon {
    color: var(--energy-red);
    transform: scale(1.3) rotate(10deg);
    text-shadow: 0 0 20px var(--energy-red);
}

.category-card h5 {
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    font-size: 1.2rem;
}

.category-card p {
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
}

.btn-category {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 10px 25px;
    border-radius: var(--radius-full);
    font-weight: 700;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-block;
}

.btn-category:hover {
    background: var(--primary-blue);
    color: var(--pure-white);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 34, 68, 0.4);
}

/* Enhanced Buttons */
.btn-primary {
    background: var(--gradient-energy);
    border: none;
    color: var(--text-dark);
    padding: 12px 30px;
    border-radius: var(--radius-full);
    font-weight: 700;
    transition: all var(--transition-normal);
    border: white solid 2px;
    box-shadow: var(--shadow-energy);
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 215, 0, 0.5);
    color: var(--text-dark);
}

.btn-view-all {
    background: var(--primary-blue);
    border: 3px solid var(--pure-white);
    color: var(--pure-white);
    padding: 15px 40px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1.1rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-blue);
    text-decoration: none;
    display: inline-block;
}

.btn-view-all:hover {
    background: var(--pure-white);
    color: var(--primary-blue);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 17, 51, 0.5);
}

/* Features Section */
.features-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
    height: 100%;
    overflow: hidden;
    position: relative;
}

.features-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-energy);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.features-card:hover::before {
    opacity: 0.05;
}

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

.features-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    transition: all var(--transition-normal);
}

.features-card:hover .features-icon {
    transform: scale(1.2);
    text-shadow: 0 0 20px currentColor;
}

/* Footer */
.footer {
    background: var(--gradient-dark);
    color: var(--text-primary);
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-top: 4rem;
    border-top: 4px solid var(--energy-yellow);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-energy);
    animation: energyFlow 4s ease-in-out infinite;
}

@keyframes energyFlow {

    0%,
    100% {
        opacity: 0.5;
        transform: scaleX(1);
    }

    50% {
        opacity: 1;
        transform: scaleX(1.05);
    }
}

.footer h5 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    font-size: 1.2rem;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-normal);
}

.footer a:hover {
    color: var(--energy-yellow);
    text-shadow: 0 0 10px var(--energy-yellow);
    transform: translateX(5px);
}

.social-links a {
    display: inline-block;
    width: 50px;
    height: 50px;
    background: var(--pure-white);
    color: var(--primary-blue);
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    font-size: 1.3rem;
    margin: 0 8px;
    transition: all var(--transition-normal);
    border: 2px solid var(--primary-blue);
    text-decoration: none;
}

.social-links a:hover {
    background: var(--primary-blue);
    color: var(--pure-white);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 34, 68, 0.5);
}

/* Special Effects */
.electric-border {
    position: relative;
    overflow: hidden;
}

.electric-border::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: var(--gradient-energy);
    border-radius: inherit;
    z-index: -1;
    animation: electricBorder 3s ease-in-out infinite;
}

@keyframes electricBorder {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

.power-glow {
    animation: powerGlow 3s ease-in-out infinite;
}

@keyframes powerGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    }

    50% {
        box-shadow:
            0 0 40px rgba(255, 215, 0, 0.7),
            0 0 80px rgba(255, 0, 0, 0.4),
            0 0 120px rgba(255, 69, 0, 0.2);
    }
}

@media (max-width: 1280px) {
    .search-form{
        display: none !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --spacing-xl: 2rem;
    }

    .hero-section {
        padding: 2rem 1rem;
    }

    .card-img-container {
        height: 350px;
    }

    .category-card .card-body {
        padding: 2rem;
    }

    .category-icon {
        font-size: 3rem;
    }

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

    .nav-link {
        padding: 10px 15px !important;
        margin: 2px 0;
    }

    .user-actions {
        margin-top: 30px !important;
        margin-bottom: 30px !important;
        font-size: x-large;
    }
}

@media (max-width: 576px) {
    .hero-section {
        text-align: center;
        padding: 1.5rem;
    }

    .card-img-container {
        height: 350px;
    }

    .btn-energy,
    .btn-view-all {
        padding: 12px 25px;
        font-size: 1rem;
    }

    .category-card .card-body {
        padding: 1.5rem;
    }

    .social-links a {
        width: 45px;
        height: 45px;
        line-height: 45px;
        font-size: 1.1rem;
    }
}

/* Loading Animation */
.loading {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Utility Classes */
.text-energy {
    color: var(--energy-yellow);
}

.text-gradient {
    background: var(--gradient-energy);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
}

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

.shadow-glow {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

/* Animation Classes */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--primary-dark);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--energy-red);
}