/* Main stylesheet */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 5px;
}

.tagline {
    color: #666;
    font-size: 1.1em;
}

.breadcrumb {
    color: #666;
    margin-top: 10px;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Main Navigation */
/* Hamburger Menu Button */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    margin-top: 15px;
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background: #ffeb3b;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Navigation */
.main-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 15px;
    padding: 10px 0;
    border-top: 1px solid #e2e8f0;
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.nav-group {
    display: contents;
}

.nav-group-title {
    display: none;
}

.nav-link {
    padding: 10px 16px;
    background: #f7fafc;
    color: #ffeb3b !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    flex: none;
}

.nav-link:hover {
    background: #fb923c;
    color: #ffeb3b !important;
}

.nav-link.active {
    background: #fb923c;
    color: #ffeb3b !important;
}

/* Main content */
main {
    background: white;
    margin: 30px auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Narrower form container for post-code page */
main.post-code-container {
    max-width: 700px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1em;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Location Selector */
.location-selector {
    background: #f7fafc;
    padding: 30px;
    border-radius: 10px;
    margin: 30px 0;
}

.location-selector h2 {
    color: #2d3748;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2d3748;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    color: #718096;
    margin-top: 5px;
    font-size: 0.9em;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

/* How It Works */
.how-it-works {
    margin-top: 50px;
}

.how-it-works h2 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 30px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.step {
    text-align: center;
    padding: 20px;
}

.step-number {
    width: 50px;
    height: 50px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    margin: 0 auto 15px;
}

.step h3 {
    color: #2d3748;
    margin-bottom: 10px;
}

/* Browse page */
.browse-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

.browse-main {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.browse-left {
    flex: 0 0 60%;
    min-width: 0;
}

.right-sidebar {
    flex: 0 0 40%;
    position: sticky;
    top: 20px;
}

.left-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

/* Filter buttons */
.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 15px;
    background: #f7fafc;
    border-radius: 5px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9em;
}

/* Trainer cards */
.trainers-list {
    margin-top: 20px;
}

.trainer-card {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.trainer-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.trainer-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.team-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.trainer-info h3 {
    color: #2d3748;
    margin-bottom: 5px;
}

.time-posted {
    color: #718096;
    font-size: 0.9em;
}

.trainer-code {
    background: #f7fafc;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.copy-code-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.copy-code-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    transform: scale(1.05);
}

.copy-code-btn:active {
    transform: scale(0.95);
}

.trainer-location {
    padding: 10px 0;
    color: #2d3748;
}

.trainer-location a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.trainer-location a:hover {
    text-decoration: underline;
}

.trainer-dates {
    padding: 10px 0;
    color: #4a5568;
    font-size: 0.9em;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.trainer-dates > div {
    flex: 1;
    min-width: 200px;
}

.code-display {
    font-size: 1.2em;
    font-weight: bold;
    color: #fbbf24;
    letter-spacing: 2px;
}

.trainer-interests {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-raid {
    background: #feb2b2;
    color: #742a2a;
}

.badge-pvp {
    background: #fc8181;
    color: #742a2a;
}

.badge-gifts {
    background: #90cdf4;
    color: #2c5282;
}

.badge-campfire {
    background: #fbd38d;
    color: #744210;
}

.trainer-actions {
    margin-top: 15px;
}

.no-results {
    text-align: center;
    padding: 50px 20px;
}

.no-results p {
    font-size: 1.2em;
    color: #718096;
    margin-bottom: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #718096;
    cursor: pointer;
}

.close-btn:hover {
    color: #2d3748;
}

.qr-code-image {
    display: block;
    max-width: 300px;
    margin: 20px auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.copy-icon {
    cursor: pointer;
    font-size: 1.2em;
    margin-left: 8px;
    display: inline-block;
    transition: transform 0.2s;
}

.copy-icon:hover {
    transform: scale(1.2);
}

.qr-instructions {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #fbbf24;
}

.qr-instructions p {
    margin: 10px 0;
    font-size: 0.95em;
}

.qr-instructions strong {
    color: var(--accent-primary);
}

.qr-instructions ol {
    margin: 10px 0 10px 20px;
    padding: 0;
}

.qr-instructions li {
    margin: 8px 0;
    line-height: 1.5;
}

.qr-note {
    color: #fbbf24;
    font-weight: 600;
    margin-top: 15px !important;
    font-size: 0.9em !important;
}

#qr-trainer-code,
#qr-trainer-name {
    text-align: center;
    font-size: 1.1em;
    margin: 10px 0;
}

/* Forms */
fieldset {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

legend {
    color: #2d3748;
    font-weight: 600;
    font-size: 1.1em;
    padding: 0 10px;
}

.required {
    color: #e53e3e;
}

.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    transition: background 0.3s;
}

.checkbox-label:hover,
.radio-label:hover {
    background: #f7fafc;
}

.privacy-notice {
    background: #e6fffa;
    border-left: 4px solid #38b2ac;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.form-result {
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    display: none;
}

.form-result.success {
    background: #c6f6d5;
    border: 2px solid #48bb78;
    color: #22543d;
}

.form-result.error {
    background: #fed7d7;
    border: 2px solid #e53e3e;
    color: #742a2a;
}

.form-result.loading {
    background: #bee3f8;
    border: 2px solid #3182ce;
    color: #2c5282;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 0;
    text-align: center;
    margin-top: 30px;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

/* Entries Table */
.entries-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.entries-table thead {
    background: #667eea;
    color: white;
}

.entries-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
}

.entries-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.entries-table tbody tr:hover {
    background: #f7fafc;
}

.entries-table tbody tr:last-child td {
    border-bottom: none;
}

.entries-table a {
    color: #667eea;
    text-decoration: none;
}

.entries-table a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    /* Layout adjustments */
    .browse-main {
        flex-direction: column;
    }
    
    .browse-left {
        flex: 1 1 auto;
    }
    
    .right-sidebar {
        position: static !important;
        flex: 1 1 auto;
        width: 100% !important;
        order: -1;
    }
    
    .left-content {
        padding: 20px 15px;
    }
    
    /* Header adjustments */
    header {
        padding: 15px 0;
    }
    
    header .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    .tagline {
        font-size: 0.9em;
    }
    
    /* Navigation */
    /* Mobile Navigation - Hamburger Menu */
    .hamburger-menu {
        display: flex;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: #2d3748;
        display: flex;
        flex-direction: column;
        gap: 0;
        margin: 0;
        padding: 80px 20px 20px;
        border: none;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        transition: right 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 1000;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .nav-group {
        display: flex;
        flex-direction: column;
        margin-bottom: 25px;
        width: 100%;
    }
    
    .nav-group-title {
        display: block;
        color: #a0aec0;
        font-size: 0.75em;
        font-weight: bold;
        letter-spacing: 1px;
        padding: 10px 15px 8px;
        margin-bottom: 5px;
        border-bottom: 1px solid #4a5568;
        width: 100%;
        box-sizing: border-box;
    }
    
    .nav-link {
        flex: none;
        display: block;
        width: 100%;
        text-align: left;
        padding: 12px 15px;
        font-size: 0.95em;
        color: #ffeb3b !important;
        background: transparent;
        border-radius: 6px;
        margin-bottom: 5px;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: #4a5568;
    }
    
    /* Overlay when menu is open */
    body.nav-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    /* Steps section */
    .steps {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .step {
        padding: 20px 15px;
    }
    
    .step-number {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }
    
    /* Forms */
    .location-selector {
        padding: 25px 15px;
    }
    
    .post-form fieldset {
        padding: 20px 15px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons */
    .quick-actions,
    .action-buttons,
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 1em;
    }
    
    .btn-small {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    /* Trainer cards */
    .trainer-card {
        padding: 15px;
    }
    
    .trainer-header {
        flex-wrap: wrap;
    }
    
    .trainer-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .trainer-actions .btn {
        width: 100%;
    }
    
    /* Filter buttons */
    .filter-buttons {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.9em;
    }
    
    /* Tables */
    .entries-table {
        font-size: 0.85em;
    }
    
    .entries-table th,
    .entries-table td {
        padding: 8px 6px;
    }
    
    /* Hide less important columns on mobile */
    .entries-table .hide-mobile {
        display: none;
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        margin: 10px;
        padding: 20px;
    }
    
    /* QR Modal */
    .qr-code-image {
        max-width: 250px;
    }
}
