/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --matrix-green: #00ff41;
    --matrix-cyan: #00f7ff;
    --matrix-blue: #0088ff;
    --matrix-dark: #001100;
    --matrix-darker: #000a00;
    --matrix-gray: #0a1a0a;
    --matrix-light: #00ff9d;
    --matrix-red: #ff003c;
    --matrix-glow: 0 0 10px var(--matrix-green);
    --matrix-text: #ccffcc;
    --matrix-text-dim: #88aa88;
    --matrix-border: #003300;
}

body {
    font-family: 'Share Tech Mono', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--matrix-darker);
    color: var(--matrix-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Matrix Background */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(0, 20, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 20, 0, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    pointer-events: none;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 255, 65, 0.03) 50%
    );
    background-size: 100% 4px;
    z-index: 0;
    pointer-events: none;
    animation: scanline 10s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0px); }
    100% { transform: translateY(4px); }
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--matrix-border);
    margin-bottom: 40px;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--matrix-green), transparent);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--matrix-green);
    box-shadow: var(--matrix-glow);
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--matrix-green) 0%, var(--matrix-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.neon-green {
    color: var(--matrix-green);
    text-shadow: 0 0 10px var(--matrix-green);
}

.neon-cyan {
    color: var(--matrix-cyan);
    text-shadow: 0 0 10px var(--matrix-cyan);
}

.neon-red {
    color: var(--matrix-red);
    text-shadow: 0 0 10px var(--matrix-red);
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Bot Status */
.bot-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 20, 0, 0.7);
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid var(--matrix-border);
    transition: all 0.3s ease;
}

.bot-status:hover {
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--matrix-text-dim);
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: var(--matrix-green);
    box-shadow: 0 0 10px var(--matrix-green);
}

.system-time {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: var(--matrix-green);
    text-shadow: 0 0 5px var(--matrix-green);
    padding: 8px 16px;
    background: rgba(0, 20, 0, 0.5);
    border-radius: 20px;
    border: 1px solid var(--matrix-border);
}

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

/* Main Content */
.main-content {
    display: grid;
    gap: 40px;
    margin-bottom: 60px;
}

/* Generator Section */
.generator-section {
    position: relative;
}

.generator-card {
    background: rgba(0, 20, 0, 0.3);
    border-radius: 16px;
    padding: 40px;
    border: 1px solid var(--matrix-border);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.generator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--matrix-green), transparent);
}

.generator-card h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.generator-card h2 i {
    color: var(--matrix-green);
}

.generator-card > p {
    color: var(--matrix-text-dim);
    margin-bottom: 30px;
    font-size: 16px;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.5px;
}

/* Form Styles */
.generate-form {
    display: grid;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--matrix-text);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
}

.form-group label i {
    color: var(--matrix-green);
    width: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

textarea, input, select {
    padding: 16px;
    background: rgba(0, 30, 0, 0.3);
    border: 1px solid var(--matrix-border);
    border-radius: 8px;
    color: var(--matrix-text);
    font-size: 14px;
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 44px;
    font-family: 'Share Tech Mono', monospace;
}

textarea:focus, input:focus, select:focus {
    outline: none;
    border-color: var(--matrix-green);
    box-shadow: 0 0 0 3px rgba(0, 255, 65, 0.1);
}

textarea {
    min-height: 120px;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--matrix-text-dim);
    font-family: 'Share Tech Mono', monospace;
}

/* Generate Button */
.generate-btn {
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.2), rgba(0, 255, 255, 0.2));
    color: var(--matrix-green);
    padding: 16px 32px;
    border: 1px solid var(--matrix-green);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 100;
    width: 100%;
}

.generate-btn:hover:not(:disabled) {
    background: rgba(0, 255, 65, 0.3);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.5);
    transform: translateY(-2px);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Discord Links */
.discord-links {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--matrix-border);
    text-align: center;
}

.discord-links p {
    color: var(--matrix-text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-family: 'Share Tech Mono', monospace;
}

.discord-links a {
    color: var(--matrix-green);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.discord-links a:hover {
    text-shadow: 0 0 10px var(--matrix-green);
}

/* Terminal Window */
.terminal-window {
    background: rgba(0, 20, 0, 0.5);
    border-radius: 8px;
    border: 1px solid var(--matrix-border);
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.1);
}

.terminal-window.error {
    border-color: var(--matrix-red);
    box-shadow: 0 0 30px rgba(255, 0, 60, 0.1);
}

.terminal-header {
    background: rgba(0, 30, 0, 0.8);
    padding: 16px 20px;
    border-bottom: 1px solid var(--matrix-border);
}

.terminal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: var(--matrix-green);
    display: flex;
    align-items: center;
    gap: 10px;
}

.terminal-body {
    padding: 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
}

.terminal-line {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.prompt {
    color: var(--matrix-green);
    font-weight: bold;
    min-width: 20px;
}

.highlight {
    color: var(--matrix-cyan);
    background: rgba(0, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Loading Animation */
.loading-animation {
    margin: 20px 0;
}

.loading-bar {
    width: 100%;
    height: 20px;
    background: rgba(0, 30, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--matrix-border);
    margin-bottom: 15px;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--matrix-dark), var(--matrix-green));
    border-radius: 10px;
    animation: loading 2s infinite;
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

/* Image Preview */
.image-preview-container {
    margin: 20px 0;
}

.image-frame {
    position: relative;
    border: 2px solid var(--matrix-border);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 20, 0, 0.5);
}

.generated-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.image-frame:hover .generated-image {
    transform: scale(1.02);
}

.image-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 20, 0, 0.3);
    border-radius: 5px;
    border: 1px solid var(--matrix-border);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--matrix-text-dim);
    font-family: 'Share Tech Mono', monospace;
}

.stat-value {
    font-size: 14px;
    color: var(--matrix-green);
    font-family: 'Share Tech Mono', monospace;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn {
    padding: 15px 25px;
    border: 1px solid var(--matrix-border);
    border-radius: 8px;
    background: rgba(0, 30, 0, 0.5);
    color: var(--matrix-text);
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn.primary {
    border-color: var(--matrix-green);
    color: var(--matrix-green);
}

.btn.secondary {
    border-color: var(--matrix-cyan);
    color: var(--matrix-cyan);
}

.btn.discord {
    border-color: #5865F2;
    color: #5865F2;
}

.btn:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    transform: translateY(-2px);
}

/* Recent Images */
.recent-section h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--matrix-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.recent-image-item {
    background: rgba(0, 20, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--matrix-border);
}

.recent-image-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 255, 65, 0.2);
}

.recent-image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--matrix-border);
}

.recent-image-info {
    padding: 16px;
}

.recent-image-info p {
    font-size: 12px;
    margin-bottom: 8px;
    color: var(--matrix-text-dim);
}

.recent-image-info strong {
    color: var(--matrix-text);
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--matrix-border);
    color: var(--matrix-text-dim);
    font-size: 14px;
    font-family: 'Share Tech Mono', monospace;
}

.footer a {
    color: var(--matrix-green);
    text-decoration: none;
}

.footer a:hover {
    text-shadow: 0 0 10px var(--matrix-green);
}

.footer code {
    background: rgba(0, 30, 0, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--matrix-cyan);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .recent-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .generator-card {
        padding: 24px;
    }
    
    .discord-links p {
        flex-direction: column;
        gap: 4px;
    }
    
    .header-right {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .recent-images-grid {
        grid-template-columns: 1fr;
    }
    
    .generator-card h2 {
        font-size: 24px;
    }
    
    .logo h1 {
        font-size: 24px;
    }
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 20, 0, 0.3);
}

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

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

/* Selection */
::selection {
    background: rgba(0, 255, 65, 0.3);
    color: var(--matrix-green);
}

/* Focus States */
button:focus, 
textarea:focus, 
input:focus, 
select:focus {
    outline: 2px solid var(--matrix-green);
    outline-offset: 2px;
}