/* =========================================
   PIXELLINK - MAIN STYLESHEET
   Main CSS file for PixelLink system
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

/* CSS Variables */
:root {
    --bg-dark: #0a0a0a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --primary-green: #00ff00;
    --primary-cyan: #00ffff;
    --primary-magenta: #ff00ff;
    --primary-blue: #0080ff;
    --primary-yellow: #ffff00;
    --primary-orange: #ff8000;
    --primary-red: #ff0000;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #333333;
    --success: #00aa66;
    --error: #ff4444;
    --warning: #ffaa00;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(45deg, var(--bg-dark), var(--bg-secondary), var(--bg-tertiary));
    color: var(--primary-green);
    overflow-x: hidden;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Main layout containers */
.main-container {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* Top Bar Styles */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(45deg, var(--bg-secondary), var(--bg-tertiary));
    border-bottom: 1px solid var(--primary-green);
    padding: 10px 15px;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    flex-wrap: nowrap;
    gap: 10px;
    height: 80px;
    width: 100vw;
    flex-shrink: 0;
    position: relative;
    z-index: 1000;
    margin: 0;
}

.nav {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
}

/* Navigation Button Base Styles */
.nav-btn {
    padding: 10px 18px;
    background: linear-gradient(45deg, var(--bg-secondary), var(--bg-tertiary));
    border: 2px solid;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.9rem;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Individual Navigation Button Colors */
.nav-btn:nth-child(1) {
    border-color: var(--primary-green);
    color: var(--primary-green);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    text-shadow: 0 0 8px var(--primary-green);
}

.nav-btn:nth-child(1):hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--text-primary);
}

.nav-btn:nth-child(2) {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    text-shadow: 0 0 8px var(--primary-cyan);
}

.nav-btn:nth-child(2):hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--text-primary);
}

.nav-btn:nth-child(3) {
    border-color: var(--primary-magenta);
    color: var(--primary-magenta);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
    text-shadow: 0 0 8px var(--primary-magenta);
}

.nav-btn:nth-child(3):hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.8);
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--text-primary);
}

.nav-btn:nth-child(4) {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    box-shadow: 0 0 15px rgba(0, 128, 255, 0.3);
    text-shadow: 0 0 8px var(--primary-blue);
}

.nav-btn:nth-child(4):hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 128, 255, 0.8);
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--text-primary);
}

.nav-btn:nth-child(5) {
    border-color: var(--primary-yellow);
    color: var(--primary-yellow);
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.3);
    text-shadow: 0 0 8px var(--primary-yellow);
}

.nav-btn:nth-child(5):hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--text-primary);
}

.nav-btn:nth-child(6) {
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    box-shadow: 0 0 15px rgba(255, 128, 0, 0.3);
    text-shadow: 0 0 8px var(--primary-orange);
}

.nav-btn:nth-child(6):hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 128, 0, 0.8);
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--text-primary);
}

/* Brand Section */
.brand-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
    margin-left: 20px;
}

.nav-logo {
    padding: 10px 18px;
    background: linear-gradient(45deg, var(--bg-secondary), var(--bg-tertiary));
    border: 3px solid var(--primary-red);
    height: 50px;
    width: auto;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--text-primary);
}

/* Stats Section */
.stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 8px;
}

.stat-number {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--primary-cyan);
    text-shadow: 0 0 8px var(--primary-cyan);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--primary-green);
}

/* Donate Buttons */
.donate-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.donate-btn-small {
    padding: 10px 18px;
    background: linear-gradient(45deg, var(--bg-secondary), var(--bg-tertiary));
    border: 2px solid var(--primary-orange);
    color: var(--primary-orange);
    text-decoration: none;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 128, 0, 0.3);
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 8px var(--primary-orange);
    white-space: nowrap;
}

.donate-btn-small:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 128, 0, 0.8);
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--text-primary);
}

/* Main Content Area */
#homeSection {
    flex: 1;
    width: 100vw;
    height: calc(100vh - 140px); /* Header + Donation Banner */
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Pixel Grid */
.pixel-grid {
    display: grid;
    gap: 0.5px;
    background: #000;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 4px solid;
    border-image: linear-gradient(45deg, var(--primary-magenta), var(--primary-cyan), var(--primary-green), var(--primary-yellow)) 1;
    animation: borderShift 4s ease-in-out infinite;
}

@keyframes borderShift {
    0%, 100% { border-image-source: linear-gradient(45deg, var(--primary-magenta), var(--primary-cyan), var(--primary-green), var(--primary-yellow)); }
    25% { border-image-source: linear-gradient(45deg, var(--primary-cyan), var(--primary-green), var(--primary-yellow), var(--primary-magenta)); }
    50% { border-image-source: linear-gradient(45deg, var(--primary-green), var(--primary-yellow), var(--primary-magenta), var(--primary-cyan)); }
    75% { border-image-source: linear-gradient(45deg, var(--primary-yellow), var(--primary-magenta), var(--primary-cyan), var(--primary-green)); }
}

/* Pixel Cells */
.pixel {
    width: 100%;
    height: 100%;
    background: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #111;
    position: relative;
}

.pixel:hover {
    background: var(--primary-green);
    box-shadow: 0 0 10px var(--primary-green);
    transform: scale(1.1);
    z-index: 10;
}

.pixel:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: var(--primary-green);
    padding: 5px 10px;
    border: 1px solid var(--primary-green);
    font-size: 10px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.pixel.claimed {
    background: linear-gradient(45deg, var(--primary-magenta), var(--primary-cyan));
    animation: sparkle 2s ease-in-out infinite;
}

.pixel.claimed:hover {
    background: linear-gradient(45deg, var(--primary-yellow), var(--primary-magenta));
    animation: none;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(45deg, var(--bg-secondary), var(--bg-tertiary));
    margin: 5% auto;
    padding: 30px;
    border: 3px solid var(--primary-green);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--primary-green);
    box-shadow: 0 0 50px rgba(0, 255, 0, 0.5);
    position: relative;
}

.close {
    color: var(--primary-magenta);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--primary-cyan);
    text-shadow: 0 0 10px var(--primary-cyan);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-cyan);
    font-weight: 700;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    background: #000;
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    font-family: 'Orbitron', monospace;
    border-radius: 0;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, var(--primary-magenta), var(--primary-cyan));
    border: 2px solid var(--primary-green);
    color: #000;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.submit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.8);
}

/* Content Sections */
.content-section {
    display: none;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--primary-green);
    padding: 30px;
    margin: 20px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    color: var(--text-primary);
    line-height: 1.6;
}

.content-section h2 {
    color: var(--primary-cyan);
    margin-bottom: 20px;
    text-align: center;
}

.content-section h3 {
    color: var(--primary-cyan);
    margin: 20px 0 10px 0;
}

.content-section p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

/* Pixel List Styles */
.pixel-item {
    padding: 15px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(26, 26, 46, 0.5);
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.pixel-item:hover {
    background: rgba(26, 26, 46, 0.8);
    border-left: 4px solid var(--primary-green);
}

.pixel-item:last-child {
    border-bottom: none;
}

.pixel-link {
    color: var(--primary-cyan);
    text-decoration: none;
    transition: color 0.3s ease;
    margin-right: 10px;
}

.pixel-link:hover {
    color: var(--primary-magenta);
    text-shadow: 0 0 5px var(--primary-magenta);
}

.delete-btn {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
}

.delete-btn:hover {
    background: #ff3333;
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--primary-red);
}

/* Admin Panel */
.admin-panel {
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid var(--primary-red);
    padding: 20px;
    margin: 20px 0;
    display: none;
}

.admin-input {
    width: 200px;
    padding: 10px;
    margin: 10px;
    background: #000;
    border: 2px solid var(--primary-red);
    color: var(--primary-red);
    font-family: 'Orbitron', monospace;
}

.admin-btn {
    padding: 10px 20px;
    background: var(--primary-red);
    color: white;
    border: none;
    cursor: pointer;
    margin: 10px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    transition: all 0.3s ease;
}

.admin-btn:hover {
    background: #ff3333;
    box-shadow: 0 0 10px var(--primary-red);
}

/* Language Switcher */
.lang-switcher {
    position: absolute;
    top: 10px;
    right: 10px;
}

.lang-btn {
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    padding: 5px 10px;
    margin: 0 2px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Orbitron', monospace;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(0, 255, 255, 0.4);
}

.lang-btn.active {
    background: var(--primary-cyan);
    color: #000;
}

/* Access Code Display */
.access-code-display {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid var(--primary-green);
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--primary-green);
    text-shadow: 0 0 10px var(--primary-green);
}

/* Management Page Styles */
.management-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
}

.user-pixels {
    margin-top: 30px;
}

.user-pixel-item {
    background: rgba(26, 26, 46, 0.5);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.user-pixel-item:hover {
    border-color: var(--primary-green);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.pixel-info {
    flex: 1;
}

.pixel-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: 2px solid;
    background: transparent;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.btn-primary:hover {
    background: var(--primary-green);
    color: #000;
    box-shadow: 0 0 15px var(--primary-green);
}

.btn-danger {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.btn-danger:hover {
    background: var(--primary-red);
    color: #000;
    box-shadow: 0 0 15px var(--primary-red);
}

/* Footer Styles */
footer {
    background: linear-gradient(45deg, var(--bg-secondary), var(--bg-tertiary));
    border-top: 2px solid var(--primary-green);
    padding: 40px 0 20px;
    margin-top: auto;
    color: var(--text-secondary);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-section h4 {
    color: var(--primary-green);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-green);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--bg-secondary);
    border: 2px solid var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--primary-green);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .top-bar {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .nav-btn, .donate-btn-small {
        font-size: 0.8rem;
        padding: 8px 14px;
        height: 45px;
    }
    
    .nav-logo {
        height: 45px;
        min-width: 100px;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        height: auto;
        padding: 10px;
        gap: 10px;
    }
    
    .nav {
        order: 1;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats {
        order: 2;
        gap: 10px;
    }
    
    .donate-buttons {
        order: 3;
    }
    
    .nav-btn, .donate-btn-small {
        font-size: 0.7rem;
        padding: 6px 12px;
        height: 40px;
    }
    
    .nav-logo {
        height: 40px;
        min-width: 80px;
        padding: 6px 12px;
    }
    
    .stat-number {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.6rem;
    }
    
    .pixel-grid {
        gap: 0.3px;
    }

    .content-section {
        margin: 10px;
        padding: 20px;
    }
    
    #homeSection {
        height: calc(100vh - 160px); /* Adjusted for mobile header */
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 2% auto;
        width: 95%;
        padding: 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .pixel-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .pixel-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Print Styles */
@media print {
    .donation-top-banner,
    .theme-toggle,
    .nav,
    .donate-buttons {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .pixel-grid {
        border: 1px solid #000 !important;
    }
}