/* CSS variables */
:root {
    --primary: #3498db;
    --secondary: #2c3e50;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #f1c40f;
    --accent1: #feb47b;
    --accent2: #ff7e5f;
    --light: #ffffff;
    --dark: #000000;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: white;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

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

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to right, #ff7e5f, #feb47b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #feb47b;
}

/* Form elements styling */
select, input, button {
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    margin: 5px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

button {
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-weight: bold;
    min-width: 120px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
}

#step-btn {
    background: var(--success);
}

#reset-btn {
    background: var(--danger);
}

/* Tape visualization */
.tape-container {
    margin: 20px 0;
    overflow-x: auto;
}

.tape {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 15px;
    min-height: 100px;
}

.cell {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    font-size: 1.5rem;
    font-weight: bold;
    background: rgba(44, 62, 80, 0.7);
    border-radius: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.cell.active {
    background: #f39c12;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.7);
}

.head {
    position: absolute;
    top: -30px;
    left: 50%;
    font-size: 2rem;
}

@keyframes bounceArrow {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
  }
  
  .head {
    color: #f1c40f;
    animation: bounceArrow 1s infinite;
  }
  

/* Status display */
.status-card {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-top: 20px;
}

.status-item {
    background: rgba(44, 62, 80, 0.7);
    padding: 15px;
    border-radius: 8px;
    min-width: 200px;
    text-align: center;
    margin: 10px;
}

.status-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #f1c40f;
    margin-top: 5px;
}

.status-ready {
    color: #3498db;
}

.status-running {
    color: #f1c40f;
    animation: pulse 1.5s infinite;
}

.status-accepted {
    color: #2ecc71;
    animation: celebrate 0.5s 3;
}

.status-rejected {
    color: #e74c3c;
}

/* Responsive design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    .status-card {
        flex-direction: column;
    }
    
    .cell {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .head {
        font-size: 1.5rem;
        top: -25px;
    }
}

/* Animations */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes celebrate {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.control-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

label {
    font-weight: bold;
    margin-right: 5px;
}

footer {
    text-align: center;
    padding: 25px 20px;
    margin-top: 50px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

.copyright {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.copyright a {
    color: #feb47b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright a:hover {
    color: #ff7e5f;
    text-decoration: underline;
}

.legal-links {
    margin: 10px 0;
}

.legal-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.legal-links a:hover {
    color: #3498db;
}

.project-info {
    margin-top: 15px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease, fadeOut 0.5s ease 4.5s;
}

.notification.error {
    background-color: #e74c3c;
}

.notification.success {
    background-color: #2ecc71;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

#auto-step-btn.active {
    background-color: #f39c12;
}

#speed-control {
    width: 200px;
    margin: 0 10px;
}

#speed-display {
    min-width: 60px;
    display: inline-block;
    text-align: right;
}