/* Modern Clean Tournament Design - Based on Reference */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #2d3748;
    -webkit-text-size-adjust: 100%;
    margin: 0;
    padding: 0;
}

/* Mobile-first design - container comes from header.php */
@media (max-width: 767px) {
    .container {
        max-width: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
        background: white;
        min-height: 100vh;
    }
    
    .mobile-header {
        display: block !important;
        background: white;
        padding: 20px 16px;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .mobile-content {
        display: block !important;
        background: #f7fafc;
        padding: 16px;
        min-height: calc(100vh - 200px);
    }
}

/* Base styles - always visible on all devices */
.mobile-header {
    display: block;
    background: white;
    color: #1a202c;
    padding: 20px 16px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.mobile-content {
    display: block;
    background: #f7fafc;
    padding: 16px;
    min-height: 400px;
}

/* Desktop responsive changes */
@media (min-width: 768px) {
    body {
        background: #f7fafc;
        padding: 0;
    }
    
    .container {
        max-width: 1200px;
        min-height: auto;
        background: transparent;
        overflow: visible;
        margin: 0 auto;
    }
    
    /* Hide mobile header on desktop */
    .mobile-header {
        display: none;
    }
    
    /* Desktop content styling */
    .mobile-content {
        padding: 40px 20px;
        background: transparent;
        display: flex;
        flex-wrap: wrap;
        gap: 24px;
        justify-content: center;
    }
    
    .mobile-content > div:first-child {
        width: 100%;
        text-align: center;
    }
    
    .mobile-content .tournament-card {
        width: calc(50% - 12px);
        max-width: 450px;
        margin: 0;
    }
    
    /* Hide mobile-only elements on desktop */
    .fab {
        display: none;
    }
    
    .bottom-nav {
        display: none;
    }
}

/* Mobile Header */
.mobile-header {
    background: white;
    color: #1a202c;
    padding: 20px 16px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    display: block !important;
    width: 100%;
}

.mobile-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #1a202c;
}

.mobile-header p {
    color: #718096;
    font-size: 14px;
    line-height: 1.4;
}

/* Desktop Header */
.desktop-header {
    margin-bottom: 32px;
}

.desktop-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.desktop-header p {
    color: #718096;
    font-size: 16px;
}

/* Desktop Controls */
.desktop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 20px;
}

.search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

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

.filter-btn {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.filter-btn:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.filter-btn.active {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}

.add-btn {
    padding: 12px 20px;
    background: #2b6cb0;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.add-btn:hover {
    background: #2c5aa0;
}

/* Content Areas */


/* Tournament Cards */
.tournament-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    padding-top: 48px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.tournament-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e0;
}

.tournament-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    margin-top: 8px;
}

.tournament-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 4px;
}

.tournament-title a {
    color: inherit;
    text-decoration: none;
}

.tournament-subtitle {
    font-size: 14px;
    color: #718096;
    margin-bottom: 0;
}

.skill-badge {
    background: #edf2f7;
    color: #4a5568;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.skill-badge.beginner {
    background: #c6f6d5;
    color: #22543d;
}

.skill-badge.intermediate {
    background: #fed7d7;
    color: #742a2a;
}

.skill-badge.advanced {
    background: #fbb6ce;
    color: #702459;
}

.skill-badge.mixed {
    background: #bee3f8;
    color: #2a69ac;
}

.tournament-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #718096;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-icon {
    font-size: 16px;
    color: #a0aec0;
}

/* Progress Section */
.progress-section {
    margin-bottom: 20px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-text {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
}

.progress-count {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.progress-bar {
    height: 6px;
    background: #edf2f7;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4299e1;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-fill.full {
    background: #22543d;
}

.progress-fill.filling-fast {
    background: #742a2a;
}

/* Players Section */
.players-section {
    margin-bottom: 20px;
}

.players-label {
    font-size: 12px;
    color: #718096;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.players-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.player-avatar.host {
    background: #c6f6d5;
    color: #22543d;
    border-color: #9ae6b4;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
}

.status-badge.active {
    background: #c6f6d5;
    color: #22543d;
}

.status-badge.filling-fast {
    background: #fed7d7;
    color: #742a2a;
}

.status-badge.full {
    background: #edf2f7;
    color: #4a5568;
}

/* Action Buttons */
.join-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
    text-align: center;
}

.join-btn.primary {
    background: #2b6cb0;
    color: white;
}

.join-btn.primary:hover {
    background: #2c5aa0;
}

.join-btn.secondary {
    background: #edf2f7;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.join-btn.secondary:hover {
    background: #e2e8f0;
}

.join-btn.danger {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.join-btn.danger:hover {
    background: #fec5c5;
}

.join-btn.full {
    background: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
    border: 1px solid #e2e8f0;
}

/* Share Button */
.share-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4a5568;
    font-weight: 500;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.share-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    color: #2d3748;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Forms */
.form-container {
    max-width: 480px;
    margin: 2rem auto;
    background: white;
    padding: 32px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Header Navigation */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-menu a {
    text-decoration: none;
    color: #718096;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #2b6cb0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu span {
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
}

/* Mobile Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 400px;
    width: 100%;
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 16px 0;
    display: flex;
    justify-content: space-around;
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    color: #a0aec0;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-item.active {
    color: #2b6cb0;
}

.nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Mobile FAB */
.fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2b6cb0;
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.3);
    transition: transform 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .fab {
        display: none;
    }
}

/* Messages */
.message {
    margin: 16px 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
}

.message-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.message-error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.message-info {
    background: #bee3f8;
    color: #2a69ac;
    border: 1px solid #90cdf4;
}

.message-warning {
    background: #faf089;
    color: #744210;
    border: 1px solid #f6e05e;
}

/* Host Controls */
.host-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.host-controls .join-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .header-content {
        padding: 12px 16px;
    }
    
    .nav-menu {
        gap: 16px;
    }
    
    .user-menu {
        gap: 8px;
    }
    
    .nav-menu a,
    .user-menu .filter-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .mobile-content {
        padding: 12px;
        padding-bottom: 100px;
    }
}

/* iPhone specific adjustments */
@media (max-width: 480px) {
    .mobile-header {
        padding: 20px 12px 16px 12px;
    }
    
    .mobile-header h1 {
        font-size: 20px;
    }
    
    .mobile-header p {
        font-size: 13px;
    }
    
    .tournament-card {
        margin-bottom: 12px;
        padding: 16px;
        padding-top: 40px;
    }
}

/* Share Link Section */
.share-section {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
    margin: 0 -24px -24px -24px;
    border-radius: 0 0 12px 12px;
}

.share-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.share-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    background: white;
    color: #718096;
}

.copy-btn {
    padding: 8px 16px;
    background: #edf2f7;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #e2e8f0;
}

.share-helper {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 6px;
}