/* Matrix Theme CSS for John's Blazin' 5 */

/* Custom CSS Variables */
:root {
    --matrix-green: #00ff41;
    --matrix-light-green: #39ff14;
    --matrix-dark: #0d1117;
    --matrix-darker: #010409;
    --matrix-gray: #21262d;
    --section-green: #00ff41;
    --section-red: #ff4444;
    --section-yellow: #ffff00;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Monaco, 'Lucida Console', monospace;
    background: var(--matrix-darker);
    color: var(--matrix-green);
    overflow-x: hidden;
}

/* Matrix Rain Animation */
#matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.1;
}

.matrix-char {
    position: absolute;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--matrix-green);
    animation: matrix-fall linear infinite;
    text-shadow: 0 0 5px var(--matrix-green);
}

@keyframes matrix-fall {
    0% {
        transform: translateY(-100vh);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Glitch Text Effect */
.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    animation: glitch-1 2s infinite;
    color: var(--section-red);
    z-index: -1;
}

.glitch-text::after {
    animation: glitch-2 2s infinite;
    color: var(--section-yellow);
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% {
        transform: translate(0);
    }
    15%, 49% {
        transform: translate(-2px, -1px);
    }
}

@keyframes glitch-2 {
    0%, 20%, 21%, 62%, 63%, 99%, 100% {
        transform: translate(0);
    }
    21%, 62% {
        transform: translate(2px, 1px);
    }
}

/* Pulse Green Animation */
@keyframes pulse-green {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 5px var(--matrix-green);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 20px var(--matrix-green), 0 0 30px var(--matrix-green);
    }
}

/* Fade In Animation */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide Up Animation */
@keyframes slide-up {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--matrix-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--matrix-green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--matrix-light-green);
}

/* Button Hover Effects */
button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

/* Input Field Effects */
input[type="email"] {
    transition: all 0.3s ease;
    position: relative;
}

input[type="email"]:focus {
    box-shadow: 0 0 10px var(--matrix-light-green);
    transform: scale(1.02);
}

/* Table Styling */
table {
    border-collapse: collapse;
    width: 100%;
}

tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

td {
    padding: 12px 8px;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.4;
}

/* Section-specific styling */
.section-green-glow {
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.section-red-glow {
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

.section-yellow-glow {
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.3);
}

/* Loading Animation */
.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .matrix-char {
        font-size: 12px;
    }
    
    .glitch-text {
        font-size: 1.5rem;
    }
    
    table {
        font-size: 12px;
    }
    
    td {
        padding: 8px 4px;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 640px) {
    .glitch-text {
        font-size: 1.25rem;
    }
    
    table {
        font-size: 11px;
    }
    
    td {
        padding: 6px 3px;
    }
    
    /* Stack table on mobile */
    .mobile-stack {
        display: block;
    }
    
    .mobile-stack thead,
    .mobile-stack tbody,
    .mobile-stack th,
    .mobile-stack td,
    .mobile-stack tr {
        display: block;
    }
    
    .mobile-stack thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .mobile-stack tr {
        border: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 5px;
    }
    
    .mobile-stack td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: left;
    }
    
    .mobile-stack td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: var(--matrix-light-green);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .matrix-char,
    .glitch-text::before,
    .glitch-text::after,
    button::before {
        animation: none;
    }
    
    * {
        transition: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --matrix-green: #00ff00;
        --matrix-light-green: #00ff00;
        --section-green: #00ff00;
        --section-red: #ff0000;
        --section-yellow: #ffff00;
    }
}

/* Focus indicators for accessibility */
button:focus,
input:focus {
    outline: 2px solid var(--matrix-light-green);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    #matrix-rain,
    #email-gate,
    #loading-overlay {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .glitch-text::before,
    .glitch-text::after {
        display: none;
    }
}

/* Custom animations for data updates */
.data-update {
    animation: data-flash 0.5s ease-in-out;
}

@keyframes data-flash {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(0, 255, 65, 0.2);
    }
}

/* Error states */
.error-state {
    border-color: var(--section-red) !important;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.error-text {
    color: var(--section-red);
    animation: error-pulse 1s infinite;
}

@keyframes error-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Success states */
.success-state {
    border-color: var(--section-green) !important;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

/* Matrix-style typing effect */
.typing-effect {
    overflow: hidden;
    border-right: 2px solid var(--matrix-green);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--matrix-green);
    }
}