/* Base styles shared across all pages */

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

/* Shared Animations */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 107, 107, 0.5); }
    50% { box-shadow: 0 0 40px rgba(255, 107, 107, 0.8); }
}

@keyframes correctPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 40px rgba(86, 171, 47, 0.6);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 80px rgba(86, 171, 47, 1);
    }
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Typography */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Gradient Backgrounds */
.bg-colorful {
    background: linear-gradient(-45deg, #FF6B6B, #4ECDC4, #45B7D1, #FFA07A, #98D8C8);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.bg-purple {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Common Container Styles */
.container-card {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 30px;
    box-shadow: 
        0 30px 90px rgba(0,0,0,0.3),
        0 0 0 1px rgba(255,255,255,0.5) inset,
        0 0 100px rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.3);
}

/* Sparkle Effects */
.sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #fff, transparent);
    border-radius: 50%;
    animation: sparkle 2s ease-in-out infinite;
}

.sparkle:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 20%; right: 20%; animation-delay: 0.5s; }
.sparkle:nth-child(3) { bottom: 15%; left: 25%; animation-delay: 1s; }
.sparkle:nth-child(4) { bottom: 25%; right: 15%; animation-delay: 1.5s; }

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4, #45B7D1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Common Button Styles */
.btn {
    display: block;
    padding: 18px;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    text-decoration: none;
    text-align: center;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.btn:active {
    transform: translateY(-1px) scale(0.98);
}

.btn:disabled {
    background: #ccc !important;
    cursor: not-allowed;
    transform: none !important;
    opacity: 0.6;
}

.btn:disabled:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #654a8d 100%);
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #4a9428 0%, #95ca52 100%);
}

.btn-info {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: linear-gradient(135deg, #3db8af 0%, #3a8e7c 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #FFA07A 0%, #FF7F50 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ff8f61 0%, #ff6837 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d54556 100%);
}

/* Status Bar */
.status-bar {
    text-align: center;
    padding: 18px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    margin-bottom: 25px;
    font-size: 16px;
    color: #666;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        inset 3px 3px 8px rgba(0,0,0,0.1),
        inset -3px -3px 8px rgba(255,255,255,0.9);
}

.status-bar.connected {
    background: linear-gradient(135deg, #a8e063, #56ab2f);
    color: white;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(86, 171, 47, 0.4);
}

.status-bar.disconnected {
    background: linear-gradient(135deg, #FF6B6B, #EE5A6F);
    color: white;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.5);
}

/* Form Elements */
input, select {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 3px solid #ddd;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: white;
}

input:focus, select:focus {
    outline: none;
    border-color: #4ECDC4;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
    transform: scale(1.02);
}

/* Buzzer Display Styles */
.buzzers-panel {
    background: linear-gradient(145deg, #FFF9C4, #FFF59D);
    padding: 25px;
    border-radius: 20px;
    border: 3px solid #FFA07A;
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.3);
}

.buzzers-panel h3 {
    color: #F57C00;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
}

.buzzer-list {
    list-style: none;
}

.buzzer-item {
    padding: 15px 20px;
    background: linear-gradient(145deg, #fff, #FFFDE7);
    margin-bottom: 10px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 6px solid #FFA07A;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    font-weight: 600;
}

.buzzer-item:hover {
    transform: translateX(5px);
}

.buzzer-item:first-child {
    border-left-color: #56ab2f;
    background: linear-gradient(145deg, #a8e063, #8ed14a);
    font-weight: 900;
    font-size: 18px;
    animation: glow 1.5s ease-in-out infinite;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Control Group */
.control-group {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 
        8px 8px 20px rgba(0,0,0,0.1),
        -5px -5px 15px rgba(255,255,255,0.9);
    border: 2px solid rgba(255,255,255,0.5);
}

.control-group h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Answer Box Styles */
.answer-box {
    padding: 20px;
    background: linear-gradient(145deg, #fff, #f8f9fa);
    border-radius: 15px;
    border: 3px solid #ddd;
    transition: all 0.3s ease;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.1);
}

.answer-box:hover {
    transform: translateY(-3px);
    box-shadow: 8px 8px 20px rgba(0,0,0,0.15);
}

.answer-box.correct {
    border-color: #56ab2f;
    background: linear-gradient(145deg, #a8e063, #8ed14a);
    animation: glow 2s ease-in-out infinite;
}

.answer-label {
    font-weight: 900;
    color: #666;
    margin-bottom: 8px;
    font-size: 16px;
    text-transform: uppercase;
}

.answer-box.correct .answer-label {
    color: #2d5a17;
}

.answer-text {
    color: #333;
    font-weight: 600;
    font-size: 15px;
}

.answer-box.correct .answer-text {
    color: #1a3a0e;
}

/* Media Preview */
.media-preview {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 12px;
    border: 2px dashed #4ECDC4;
}

.media-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    margin: 5px;
}

.media-preview audio {
    width: 100%;
    margin-top: 10px;
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
}

