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

:root {
    --primary: #4CAF50;
    --primary-dark: #388E3C;
    --secondary: #2196F3;
    --danger: #f44336;
    --warning: #ff9800;
    --success: #4CAF50;
    --dark: #212121;
    --light: #f5f5f5;
    --white: #ffffff;
    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px var(--shadow);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 40px 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Navigation */
.nav {
    display: flex;
    background: var(--dark);
    padding: 0;
}

.nav-link {
    flex: 1;
    padding: 15px;
    text-align: center;
    color: var(--white);
    text-decoration: none;
    transition: background 0.3s;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: var(--primary);
}

/* Main Content */
.main-content {
    padding: 1rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    margin-bottom: 40px;
}

.hero-content h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 1.2rem;
    color: #666;
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.feature-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: var(--dark);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* Quick Access */
.quick-access {
    margin-top: 50px;
}

.quick-access h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark);
    font-size: 2rem;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.link-card {
    background: var(--light);
    padding: 35px;
    border-radius: 15px;
    text-align: center;
}

.link-card h3 {
    color: var(--dark);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.link-card p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-small {
    padding: 8px 20px;
    font-size: 0.9rem;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.2rem;
    width: 100%;
}

/* Upload Section */
.upload-section {
    max-width: 600px;
    margin: 0 auto;
}

.upload-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed var(--border);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(76, 175, 80, 0.05);
}

.upload-placeholder {
    color: #666;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.preview-image {
    max-width: 100%;
    border-radius: 10px;
    margin-top: 20px;
    image-orientation: from-image;
}

.file-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    margin-bottom: 15px;
}

.input-field {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
}

/* Status Messages */
.status-message {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Gallery */
.gallery-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.gallery-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 15px;
    background: var(--light);
    border-radius: 10px;
    flex-wrap: wrap;
}

.stat-item {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
}

#liveIndicator {
    color: var(--danger);
    animation: pulse 2s infinite;
}

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

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

.gallery-item {
    position: relative;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    image-orientation: from-image;
}

.gallery-item.ad {
    border: 4px solid var(--primary);
}

.ad-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    image-orientation: from-image;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 50px;
    color: var(--white);
    font-size: 3rem;
    cursor: pointer;
}

/* Admin Sections */
.admin-section {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border);
}

.admin-section:last-child {
    border-bottom: none;
}

.admin-section h2 {
    color: var(--dark);
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.form-card {
    background: var(--light);
    padding: 30px;
    border-radius: 12px;
}

/* Events List */
.events-list, .ads-list {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.event-card, .ad-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--shadow);
}

.event-card h3 {
    color: var(--dark);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.event-info {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: #666;
}

.event-info code {
    background: var(--light);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--dark);
}

.event-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* QR Display */
.qr-display {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    margin-top: 25px;
    text-align: center;
}

.qr-info {
    margin-top: 20px;
}

.qr-image {
    max-width: 300px;
    margin: 20px auto;
    display: block;
    border: 3px solid var(--primary);
    border-radius: 10px;
    padding: 15px;
    background: var(--white);
}

.qr-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

/* Info Box */
.info-box {
    background: var(--light);
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
}

.info-box h3 {
    color: var(--dark);
    margin-bottom: 15px;
}

.info-box p {
    color: #666;
    margin: 8px 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--white);
    padding: 40px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: var(--dark);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1rem;
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

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

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 25px;
    text-align: center;
}

.footer p {
    opacity: 0.8;
}

/* Ad Card */
.ad-card {
    border-left: 5px solid var(--primary);
}

.ad-card img {
    max-width: 200px;
    border-radius: 8px;
    margin: 15px 0;
}

/* Actions */
.actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    body {
    }

    .header h1 {
        font-size: 2rem;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 3fr));
        gap: 5px;
    }

    .gallery-item img {
        height: 150px;
    }

    .container {
        border-radius: 10px;
    }

    .main-content {
    }

    .quick-links {
        grid-template-columns: 1fr;
    }

    .qr-links {
        flex-direction: column;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none !important; }

