/* TedouaR Robotics Hub - Complete Fixed CSS */
:root {
    --primary-color: #00ffff;
    --secondary-color: #00ff88;
    --accent-color: #ff0080;
    --bg-color: #0a0a0f;
    --bg-secondary: #1a1a2e;
    --text-color: #e0e0ff;
    --neon-glow: 0 0 20px currentColor;
    --card-glow: 0 0 30px rgba(0, 255, 255, 0.3);
    --shadow-color: rgba(0, 0, 0, 0.5);
}

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

body {
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
    font-family: 'Inter', 'Arial', sans-serif;
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Animated Background Grid */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    padding: 20px 0;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: scan-line 3s linear infinite;
}

@keyframes scan-line {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* Logo - Fixed Size */
.logo-container {
    position: relative;
    display: flex;
    align-items: center;
}

.logo {
    height: 60px;
    width: auto;
    max-width: 180px;
    opacity: 1 !important;
    transform: scale(1) !important;
    transition: none !important;
    visibility: visible !important;
    display: block !important;
}

/* Navigation */
.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links a {
    position: relative;
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
    overflow: hidden;
    font-weight: 500;
}

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

.nav-links a:hover::before,
.nav-links a.active::before {
    left: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
    text-shadow: var(--neon-glow);
    box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.1);
}

/* Buttons */
.btn {
    position: relative;
    padding: 12px 30px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    transition: all 0.5s ease;
    z-index: -1;
}

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

.btn:hover {
    color: var(--bg-color);
    background: var(--primary-color);
    box-shadow: var(--card-glow);
    text-shadow: none;
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-color);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1rem;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Mobile Menu */
.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

/* HERO SECTION - FIXED LAYOUT */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 255, 255, 0.05) 50%, transparent 100%);
    padding-top: 120px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="circuit" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M10 0v5M0 10h5M10 15v5M15 10h5M10 10m-2 0a2 2 0 1 1 4 0a2 2 0 1 1 -4 0" stroke="rgba(0,255,255,0.1)" stroke-width="0.5" fill="none"/></pattern></defs><rect width="100" height="100" fill="url(%23circuit)"/></svg>') repeat;
    animation: circuit-flow 10s linear infinite;
    z-index: -1;
}

@keyframes circuit-flow {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

/* FIXED: Hero Container Layout */
.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.hero-content {
    z-index: 1;
}

/* FIXED: Hero Title Visibility */
.hero-title {
    font-family: 'Orbitron', monospace;
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 50px rgba(0, 255, 255, 0.5);
    animation: title-glow 3s ease-in-out infinite alternate;
    margin-bottom: 20px;
    /* Force visibility */
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

@keyframes title-glow {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.2); }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.9;
    line-height: 1.6;
    margin: 20px 0 40px 0;
    /* Force visibility */
    opacity: 0.9 !important;
    visibility: visible !important;
    display: block !important;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* FIXED: Hero Image Position - Right Side */
.hero-image {
    position: relative;
    animation: float 6s ease-in-out infinite;
    display: flex;
    justify-content: center;
    order: 2; /* Ensure it stays on the right */
}

.hero-image img {
    max-width: 100%;
    height: auto;
    opacity: 1 !important;
    transform: scale(1) !important;
    visibility: visible !important;
    display: block !important;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Sections */
section {
    padding: 80px 0;
}

.section-title {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 10px var(--primary-color);
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 50px;
}

/* Encyclopedia Container */
.encyclopedia-container {
    min-height: 100vh;
    padding-top: 120px;
    padding-bottom: 80px;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 255, 255, 0.03) 50%, transparent 100%);
}

/* Filter Section */
.filter-section {
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    margin: 40px 0 60px 0;
    position: relative;
    overflow: hidden;
}

.filter-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.05), transparent);
    transition: all 2s ease;
}

.filter-section:hover::before {
    left: 100%;
}

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 25px;
}

.search-bar input {
    width: 100%;
    background: rgba(10, 10, 15, 0.8);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 50px;
    padding: 18px 60px 18px 25px;
    font-size: 1rem;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    background: rgba(10, 10, 15, 0.9);
}

.search-bar input::placeholder {
    color: rgba(224, 224, 255, 0.5);
    font-style: italic;
}

.search-bar i {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.2rem;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Filters */
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.filter {
    position: relative;
}

.filter label {
    display: block;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.filter select {
    width: 100%;
    background: rgba(10, 10, 15, 0.8);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 15px;
    padding: 15px 20px;
    font-size: 1rem;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2300ffff" stroke-width="2"><polyline points="6,9 12,15 18,9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

.filter select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    background-color: rgba(10, 10, 15, 0.9);
}

.filter select:hover {
    border-color: rgba(0, 255, 255, 0.5);
    transform: translateY(-2px);
}

.filter select option {
    background: var(--bg-secondary);
    color: var(--text-color);
    padding: 10px;
    border: none;
}

/* CRITICAL: Robot Cards - Image Display Fixed */
.robot-card,
.category-card {
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    padding: 20px;
    /* Force immediate visibility */
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    animation: none !important;
}

.robot-card::before,
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.1), transparent);
    transition: all 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.robot-card:hover::before,
.category-card:hover::before {
    left: 100%;
}

.robot-card:hover,
.category-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--card-glow);
    border-color: var(--primary-color);
}

/* Robot Grid */
.robot-grid,
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 50px 0;
}

/* CRITICAL: Robot Images - Fixed Display */
.robot-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 20px;
    /* Force immediate visibility */
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    animation: none !important;
}

.robot-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    /* Critical: Force immediate image display */
    opacity: 1 !important;
    transform: scale(1) !important;
    visibility: visible !important;
    display: block !important;
    animation: none !important;
}

.robot-card:hover .robot-card-image img {
    transform: scale(1.1);
}

.robot-card-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.robot-card-manufacturer {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.robot-card-description {
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.5;
    margin-bottom: 15px;
}

.robot-view-details {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 15px;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    transition: all 0.3s ease;
    display: inline-block;
}

.robot-view-details:hover {
    background: var(--primary-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.category-pill {
    background: rgba(0, 255, 255, 0.2);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.2rem;
    color: var(--primary-color);
    font-family: 'Orbitron', monospace;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 255, 255, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-results,
.error-message {
    text-align: center;
    padding: 60px 20px;
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 20px;
    margin: 40px 0;
}

.no-results h2,
.error-message h2 {
    color: var(--primary-color);
    font-family: 'Orbitron', monospace;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.no-results p,
.error-message p {
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-image {
        order: -1;
    }
    
    .logo {
        height: 50px;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links,
    .auth-buttons {
        display: none;
    }
    
    .mobile-menu-button {
        display: block;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .robot-grid,
    .category-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .logo {
        height: 45px;
    }
    
    header {
        padding: 15px 0;
    }
    
    .filter-section {
        padding: 20px;
        margin: 30px 0 40px 0;
    }
    
    .search-bar input {
        padding: 15px 50px 15px 20px;
        font-size: 0.9rem;
    }
    
    .search-bar i {
        right: 20px;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .logo {
        height: 40px;
    }
    
    .filter-section {
        padding: 15px;
    }
    
    .search-bar input {
        padding: 12px 45px 12px 15px;
    }
    
    .filter select {
        padding: 12px 15px;
    }
}