* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 1200px;
    width: 100%;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    position: relative;
}

.header {
    background: #3b82f6;
    color: white;
    padding: 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 70px;
    z-index: 99;
}

.tab {
    flex: 1;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.3s ease;
}

.tab.active {
    background: white;
    color: #3b82f6;
    border-bottom: 2px solid #3b82f6;
}

.tab-content {
    display: none;
    padding: 1rem;
}

.tab-content.active {
    display: block;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 100%;
}

.screenshot-container {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.screenshot {
    width: 100%;
    height: auto;
    display: block;
}

.pokemon-area {
    position: absolute;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    z-index: 10;
}

.pokemon-area:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
    z-index: 10;
}

.pokemon-area.reserved {
    background: rgba(34, 197, 94, 0.4);
    border-color: #22c55e;
}

.pokemon-area.reserved::after {
    content: '✓ Reserved';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(34, 197, 94, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
}

/* Common row styles for Pokemon grid layout */
.pokemon-row {
    display: contents;
}

.pokemon-slot {
    width: 27%;
    height: 15%;
}

.row-1 { top: 24%; }
.row-2 { top: 41%; }
.row-3 { top: 57.5%; }
.row-4 { top: 74%; }

.col-1 { left: 5%; }
.col-2 { left: 36%; }
.col-3 { left: 68%; }

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 20px 0;
}

.modal-content {
    background: white;
    margin: 20px auto;
    padding: 1.5rem;
    border-radius: 15px;
    width: 90%;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    max-height: 90vh;
    overflow-y: auto;
}

.pokemon-snapshot {
    width: 140px;
    height: 100px;
    margin: 1rem auto;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pokemon-snapshot canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal h3 {
    margin-bottom: 1rem;
    color: #1f2937;
}

.modal input {
    width: 100%;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.modal input:focus {
    outline: none;
    border-color: #3b82f6;
}

.modal-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: #22c55e;
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.admin-panel {
    display: none;
    background: #f8fafc;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    position: sticky;
    top: 120px;
    z-index: 98;
    max-height: 50vh;
    overflow-y: auto;
}

.admin-panel.active {
    display: block;
}

.admin-login {
    text-align: center;
    padding: 2rem;
}

.admin-controls {
    display: none;
}

.admin-controls.active {
    display: block;
}

.admin-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.reservation-list {
    background: white;
    border-radius: 8px;
    margin-top: 1rem;
    max-height: calc(50vh - 120px);
    overflow-y: auto;
    position: relative;
}

.reservation-list h4 {
    position: sticky;
    top: 0;
    background: white;
    margin: 0;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    z-index: 10;
    border-radius: 8px 8px 0 0;
}

.reservation-list > div {
    padding: 0 1rem 1rem 1rem;
}

.reservation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.reservation-item:last-child {
    border-bottom: none;
}

.reservation-info {
    flex: 1;
}

.reservation-actions {
    display: flex;
    gap: 0.5rem;
}

.reservation-actions .btn {
    flex: 1;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 12px;
    width: auto;
    flex: none;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reservation-preview {
    width: 40px;
    height: 49px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
    background: #f3f4f6;
    display: inline-block;
}

.reservation-preview img {
    width: 40px;
    height: 49px;
    border-radius: 4px;
    cursor: pointer;
}

/* Utility classes for inline style replacements */
.modal-visible {
    display: block !important;
}

.modal-hidden {
    display: none !important;
}

.btn-visible {
    display: inline-block !important;
}

.btn-hidden {
    display: none !important;
}

.admin-login-container {
    margin-top: 1rem;
}

.player-name-input {
    font-size: 16px;
}

.admin-form-group {
    margin: 1rem 0;
}

.admin-form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.admin-player-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
}

.modal-separator {
    margin: 1rem 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

.admin-toggle-active {
    background: rgba(239, 68, 68, 0.8) !important;
}

.admin-toggle-inactive {
    background: rgba(255,255,255,0.2) !important;
}

.empty-state {
    text-align: center;
    color: #64748b;
    padding: 4rem 2rem;
}

.empty-state-small {
    color: #64748b;
    text-align: center;
    padding: 1rem;
}

.reservation-info-flex {
    display: flex;
    align-items: center;
}

.reservation-location {
    cursor: pointer;
}

.confirmed-status {
    color: #22c55e;
}

@media (max-width: 480px) {
    body {
        align-items: flex-start;
    }
    
    .container {
        margin: 0;
        border-radius: 0;
        width: 100%;
        max-width: none;
    }
    
    .screenshots-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .modal-content {
        margin: 10px auto;
        width: 95%;
        padding: 1rem;
        max-height: 80vh;
    }
    
    .pokemon-snapshot {
        width: 120px;
        height: 85px;
    }

    /* Fix sticky positioning for mobile */
    .header {
        position: relative;
    }
    
    .tabs {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 101;
    }

    .admin-panel {
        position: -webkit-sticky;
        position: sticky;
        top: 50px;
        z-index: 100;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 769px) {
    .screenshots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}