:root {
    /* Professional Neutral Palette */
    --primary-color: #2c3e50;
    --primary-gradient: linear-gradient(135deg, #34495e, #2c3e50);
    --secondary-color: #95a5a6;
    --accent-color: #34495e;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-muted: #95a5a6;
    
    /* Refined Status Colors */
    --success-color: #27ae60;
    --warning-color: #e67e22;
    --danger-color: #c0392b;
    --info-color: #34495e;
    
    /* Sophisticated Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #ecf0f1;
    --bg-dark: #2c3e50;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    
    /* Clean Borders & Shadows */
    --border-color: #e9ecef;
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(44, 62, 80, 0.08);
    --box-shadow-hover: 0 4px 20px rgba(44, 62, 80, 0.12);
    --transition: all 0.3s ease;
}

[data-bs-theme="dark"] {
    --primary-color: #ecf0f1;
    --secondary-color: #bdc3c7;
    --bg-primary: #2c3e50;
    --bg-secondary: #34495e;
    --bg-tertiary: #40566d;
    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    --border-color: #40566d;
    --light-color: #34495e;
    --dark-color: #ecf0f1;
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    transition: var(--transition);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* Professional Button Styles */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--box-shadow-hover);
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
    border-radius: var(--border-radius);
}

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

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: #ffffff;
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: #ffffff;
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: #ffffff;
}

.min-vh-75 {
    min-height: 75vh;
}

/* Professional Form Styles */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Professional Text Styling */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* Professional Navbar */
.navbar {
    background-color: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
}

.navbar-brand {
    color: var(--text-primary) !important;
    font-weight: 600;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
}

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

/* Logo Styles */
.logo-circle {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--box-shadow);
}

.logo-m {
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.brand-text {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* Global Video Background */
.video-background-global {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    background-image: url('../images/robotic-factory-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.video-background-global video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.video-overlay-global {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(248, 249, 250, 0.8), rgba(236, 240, 241, 0.75));
    z-index: -1;
    pointer-events: none;
}

/* Semi-transparent main content areas */
main {
    position: relative;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(2px);
    min-height: 100vh;
}

/* Navigation transparency enhancement */
.navbar {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(44, 62, 80, 0.1);
}

/* Hero section transparency */
.hero-section {
    background: rgba(44, 62, 80, 0.85) !important;
    backdrop-filter: blur(3px);
}

/* Footer transparency */
footer {
    background: rgba(44, 62, 80, 0.95) !important;
    backdrop-filter: blur(5px);
}

/* Mobile and performance optimizations */
@media (max-width: 768px) {
    .video-background-global video {
        display: none; /* Hide video on mobile for performance */
    }
    
    .video-background-global {
        background-image: url('../images/robotic-factory-bg.jpg');
        background-size: cover;
        background-position: center;
    }
    
    main {
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: none; /* Disable backdrop-filter on mobile */
    }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .video-background-global video {
        display: none;
    }
    
    .video-background-global {
        background-image: url('../images/robotic-factory-bg.jpg');
    }
    
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .video-overlay-global {
        background: rgba(255, 255, 255, 0.95);
    }
    
    main {
        background-color: rgba(255, 255, 255, 0.98);
    }
}

/* Performance enhancement for older browsers */
@supports not (backdrop-filter: blur(10px)) {
    .navbar {
        background-color: rgba(255, 255, 255, 0.98) !important;
    }
    
    main {
        background-color: rgba(255, 255, 255, 0.95);
    }
    
    .hero-section {
        background: rgba(44, 62, 80, 0.9) !important;
    }
}

/* Enhanced Robotic Factory Background Overlay */
.video-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        /* Subtle professional overlays */
        linear-gradient(45deg, transparent 85%, rgba(44, 62, 80, 0.03) 95%, transparent 100%),
        linear-gradient(-45deg, transparent 85%, rgba(52, 73, 94, 0.02) 95%, transparent 100%),
        /* Minimal grid pattern */
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 30%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 30%);
    background-size: 
        120px 120px, 
        120px 120px, 
        400px 400px, 
        400px 400px;
    animation: 
        subtle-pulse 8s ease-in-out infinite,
        gentle-shift 12s linear infinite;
    opacity: 0.3;
}

/* Futuristic AI animations */
@keyframes hologram-scan {
    0% { background-position: 0 0, 0 0, 0 0, 0 0, 0% 0; }
    50% { background-position: 40px 40px, -40px 40px, 150px 150px, -150px -150px, 50% 0; }
    100% { background-position: 80px 80px, -80px 80px, 300px 300px, -300px -300px, 100% 0; }
}

@keyframes data-pulse {
    0%, 100% { 
        filter: brightness(1) hue-rotate(0deg);
        transform: scale(1);
    }
    50% { 
        filter: brightness(1.2) hue-rotate(30deg);
        transform: scale(1.02);
    }
}

@keyframes ai-energy {
    0% { background-position: 0 0, 0 0, 0 0, 0 0, 0% 0; }
    25% { background-position: 20px 20px, -20px 20px, 75px 75px, -75px -75px, 150% 0; }
    50% { background-position: 40px 40px, -40px 40px, 150px 150px, -150px -150px, 300% 0; }
    75% { background-position: 60px 60px, -60px 60px, 225px 225px, -225px -225px, 450% 0; }
    100% { background-position: 80px 80px, -80px 80px, 300px 300px, -300px -300px, 600% 0; }
}

@keyframes subtle-pulse {
    0%, 100% { 
        filter: brightness(1) saturate(1);
        transform: scale(1);
    }
    50% { 
        filter: brightness(1.1) saturate(1.1);
        transform: scale(1.01);
    }
}

@keyframes gentle-shift {
    0% { background-position: 0 0, 0 0, 0 0, 0 0; }
    25% { background-position: 30px 30px, -30px 30px, 100px 100px, -100px -100px; }
    50% { background-position: 60px 60px, -60px 60px, 200px 200px, -200px -200px; }
    75% { background-position: 90px 90px, -90px 90px, 300px 300px, -300px -300px; }
    100% { background-position: 120px 120px, -120px 120px, 400px 400px, -400px -400px; }
}

/* Hero Section - Transparent to showcase video background */
.hero-section {
    background: transparent;
    position: relative;
    overflow: hidden;
}

/* Live Stats Badge Animation */
.badge {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.5);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.8);
        transform: scale(1.02);
    }
}

.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="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

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

.bg-gradient-primary {
    background: var(--primary-gradient) !important;
}

/* Step Numbers */
.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

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

/* Dashboard Cards */
.card-icon {
    opacity: 0.8;
}

/* Energy Bar */
.energy-container {
    position: relative;
    height: 30px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.energy-bar {
    position: relative;
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), #2ecc71);
    border-radius: var(--border-radius);
    transition: width 0.3s ease;
    overflow: hidden;
}

.energy-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: wave 2s infinite linear;
}

@keyframes wave {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(50%); }
}

/* Bot Cards */
.bot-card {
    transition: var(--transition);
}

.bot-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

.bot-stats .stat-item {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.price-tag {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Energy Package Cards */
.energy-package-card {
    transition: var(--transition);
}

.energy-package-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1);
}

.energy-icon {
    margin-bottom: 1rem;
}

.price-display .price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.feature-item {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.payment-method {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 0.5rem;
}

/* Testimonials */
.testimonial-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    padding: 1.5rem;
}

[data-bs-theme="dark"] .testimonial-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.testimonial-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
    border-color: var(--primary-color);
}

.testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

/* Video Showcase */
.video-showcase-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
}

.video-showcase-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

.video-container {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #000;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-container:hover video {
    transform: scale(1.05);
}

.video-overlay-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    opacity: 0;
    transition: var(--transition);
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.video-container:hover .video-overlay-play {
    opacity: 1;
}

.video-overlay-play:hover {
    background: rgba(59, 130, 246, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-info {
    padding: 1.5rem;
}

.video-info h5 {
    color: var(--dark-color);
    font-weight: 600;
}

[data-bs-theme="dark"] .video-showcase-card {
    background: #374151;
}

[data-bs-theme="dark"] .video-info h5 {
    color: #f9fafb;
}

/* Energy Statistics */
.energy-stat {
    padding: 1rem;
    border-radius: var(--border-radius);
    background: rgba(59, 130, 246, 0.1);
    margin-bottom: 1rem;
}

/* Referral Items */
.referral-item {
    transition: var(--transition);
}

.referral-item:hover {
    background: rgba(59, 130, 246, 0.1) !important;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e2e8f0;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

/* Navbar */
.navbar {
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.navbar-brand:hover .logo-circle {
    transform: rotate(360deg);
    transition: transform 0.6s ease;
}

/* Footer */
footer {
    background: #1e293b !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .price-display .price {
        font-size: 1.5rem;
    }
    
    /* Hide video on mobile for performance */
    .video-background {
        display: none;
    }
    
    /* Enhanced gradient background for mobile */
    .hero-section {
        background: linear-gradient(135deg, #3b82f6, #1d4ed8, #1e40af);
        background-size: 200% 200%;
        animation: gradientShift 8s ease infinite;
    }
}

/* Accessibility: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .video-background video {
        animation-play-state: paused;
    }
    
    .hero-section {
        animation: none;
    }
    
    .energy-wave {
        animation: none;
    }
}

/* Performance optimization for low-end devices */
@media (max-width: 768px), (max-height: 600px), (pointer: coarse) {
    .video-background {
        display: none;
    }
}

/* Animated gradient fallback */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Admin Panel Styles */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--secondary-color);
}

/* Dark Mode Adjustments */
[data-bs-theme="dark"] .card {
    background: #374151;
    border: 1px solid #4b5563;
}

[data-bs-theme="dark"] .energy-container {
    background: #4b5563;
}

[data-bs-theme="dark"] .form-control {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

[data-bs-theme="dark"] .form-control:focus {
    background: #374151;
    border-color: var(--primary-color);
    color: #f9fafb;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

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

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

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

/* Utility Classes */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.border-gradient {
    border: 2px solid;
    border-image: var(--primary-gradient) 1;
}

.shadow-lg-colored {
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.2), 0 4px 6px -2px rgba(59, 130, 246, 0.1);
}
