/* styles.css */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&family=Exo+2:wght@300;400;600&display=swap');

:root {
    --primary: #0ff;
    --secondary: #90f;
    --accent: #0cf;
    --dark: #0a0a1a;
    --darker: #050510;
    --light: #e0f7ff;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Exo 2', sans-serif;
    background: var(--darker);
    color: var(--light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Visually Hidden (for accessible status without layout impact) */
.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.background-effects::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(10, 10, 26, 0.9), rgba(5, 5, 16, 0.95)),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 200, 255, 0.05) 2px,
            rgba(0, 200, 255, 0.05) 4px
        );
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

/* Particle Effects */
.particle {
    position: absolute;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.7;
    animation: float 15s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 2px;
}

.logo span {
    color: var(--accent);
}

/* Main Content */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

/* Learning Animation */
.learning-animation {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
}

.robot-frame {
    position: relative;
    z-index: 2;
}

.robot-head {
    width: 120px;
    height: 100px;
    background: rgba(10, 20, 40, 0.7);
    border: 2px solid var(--primary);
    border-radius: 10px;
    position: relative;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px;
    box-shadow: 0 0 15px rgba(0, 200, 255, 0.3);
}

.eye {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--primary);
    position: relative;
    overflow: hidden;
}

.eye::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--darker);
    border-radius: 50%;
    top: 5px;
    left: 5px;
    animation: blink 5s infinite;
}

@keyframes blink {
    0%, 45%, 55%, 100% { height: 8px; }
    50% { height: 2px; }
}

.robot-body {
    width: 150px;
    height: 120px;
    background: rgba(10, 20, 40, 0.7);
    border: 2px solid var(--primary);
    border-radius: 10px;
    margin: 10px auto 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 200, 255, 0.3);
}

.circuit-line {
    position: absolute;
    height: 2px;
    background: var(--accent);
    width: 100%;
    left: 0;
    animation: circuit-flow 3s infinite linear;
}

.circuit-line:nth-child(1) { top: 20%; animation-delay: 0s; }
.circuit-line:nth-child(2) { top: 50%; animation-delay: 1s; }
.circuit-line:nth-child(3) { top: 80%; animation-delay: 2s; }

@keyframes circuit-flow {
    0% { width: 0; left: 0; }
    50% { width: 100%; }
    100% { width: 0; left: 100%; }
}

/* Data Stream */
.data-stream {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.data-bit {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 2px;
    opacity: 0;
}

.data-bit:nth-child(1) { top: 20%; left: 10%; animation: data-flow 4s infinite 0s; }
.data-bit:nth-child(2) { top: 40%; left: 70%; animation: data-flow 4s infinite 0.5s; }
.data-bit:nth-child(3) { top: 60%; left: 30%; animation: data-flow 4s infinite 1s; }
.data-bit:nth-child(4) { top: 80%; left: 80%; animation: data-flow 4s infinite 1.5s; }
.data-bit:nth-child(5) { top: 30%; left: 50%; animation: data-flow 4s infinite 2s; }

@keyframes data-flow {
    0% { opacity: 0; transform: translateY(0) translateX(0); }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-200px) translateX(50px); }
}

/* Gears */
.gears {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 0;
}

.gear {
    position: absolute;
    background: rgba(10, 20, 40, 0.7);
    border: 2px solid var(--secondary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gear::before {
    content: "";
    position: absolute;
    width: 60%;
    height: 60%;
    background: var(--darker);
    border-radius: 50%;
}

.gear.large {
    width: 80px;
    height: 80px;
    bottom: -20px;
    right: -20px;
    animation: rotate 10s infinite linear;
}

.gear.medium {
    width: 50px;
    height: 50px;
    bottom: 40px;
    right: -30px;
    animation: rotate-reverse 8s infinite linear;
}

.gear.small {
    width: 30px;
    height: 30px;
    bottom: 80px;
    right: 0;
    animation: rotate 6s infinite linear;
}

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

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

/* Message Container */
.message-container {
    text-align: center;
    padding: 2rem;
    border: 1px solid rgba(0, 200, 255, 0.3);
    border-radius: 10px;
    background: rgba(10, 20, 40, 0.3);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.2);
}

#learningMessage {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 500;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(0, 200, 255, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

/* Feedback Section */
.feedback-section {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    border: 1px solid rgba(153, 0, 255, 0.3);
    border-radius: 10px;
    background: rgba(10, 20, 40, 0.3);
    box-shadow: 0 0 20px rgba(153, 0, 255, 0.2);
}

.feedback-section h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--accent);
}

#feedbackForm {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#feedbackForm label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    color: var(--accent);
}

#feedbackInput {
    background: rgba(5, 10, 20, 0.7);
    border: 1px solid var(--secondary);
    border-radius: 5px;
    padding: 1rem;
    color: var(--light);
    font-family: 'Exo 2', sans-serif;
    font-size: 1rem;
    min-height: 120px;
    resize: vertical;
    transition: var(--transition);
}

#feedbackInput:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.5);
}

/* Improved focus styles for accessibility */
#feedbackForm button:focus,
#feedbackInput:focus {
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.35);
}

.form-help {
    font-size: 0.9rem;
    color: rgba(224, 247, 255, 0.8);
}

#feedbackForm button {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: var(--darker);
    border: none;
    border-radius: 5px;
    padding: 0.8rem 1.5rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 1px;
}

#feedbackForm button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 200, 255, 0.4);
}

.feedback-display {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(153, 0, 255, 0.2);
}

/* Reduced Motion: respect user preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

.feedback-display h4 {
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 1rem;
    color: var(--accent);
}

#feedbackList {
    list-style-type: none;
}

.feedback-item {
    background: rgba(5, 10, 20, 0.5);
    border-left: 3px solid var(--accent);
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    border-radius: 0 5px 5px 0;
    animation: fadeIn 0.5s ease;
}

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

/* Animation States */
.learning-animation.active .robot-head {
    animation: head-pulse 1s infinite;
}

@keyframes head-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 200, 255, 0.5); }
    50% { box-shadow: 0 0 20px rgba(0, 200, 255, 0.8); }
}

.learning-animation.active .robot-body {
    animation: body-glow 1s infinite;
}

@keyframes body-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 200, 255, 0.5); }
    50% { box-shadow: 0 0 25px rgba(0, 200, 255, 0.9); }
}

.learning-animation.active .gear {
    animation-duration: 2s;
}

.learning-animation.active .data-bit {
    animation-duration: 1.5s;
}

.learning-animation.active .circuit-line {
    animation-duration: 1s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .learning-animation {
        width: 250px;
        height: 250px;
    }
    
    #learningMessage {
        font-size: 1.5rem;
    }
    
    .message-container {
        padding: 1.5rem;
    }
    
    .feedback-section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .learning-animation {
        width: 200px;
        height: 200px;
    }
    
    .robot-head {
        width: 100px;
        height: 80px;
    }
    
    .robot-body {
        width: 120px;
        height: 100px;
    }
    
    #learningMessage {
        font-size: 1.2rem;
    }
}