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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Authentication Section */
.auth-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-section h1 {
    color: #00d4ff;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2.5rem;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 300px;
}

.auth-form input {
    padding: 0.8rem;
    border: 2px solid #333;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    font-size: 1rem;
}

.auth-form input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.auth-form button {
    padding: 0.8rem;
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-form button:hover {
    background: linear-gradient(45deg, #0099cc, #00d4ff);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.4);
}

/* Admin Login Link */
.admin-link {
    text-align: center;
    margin-top: 1rem;
}

.admin-login-link {
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.admin-login-link:hover {
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    text-decoration: none;
}

/* Synergy Mode Toggle */
.synergy-mode-toggle {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.mode-toggle-group {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 0.5rem;
}

.mode-toggle-group input[type="radio"] {
    display: none;
}

.mode-toggle-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    text-align: center;
    background: transparent;
    color: #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mode-toggle-group input[type="radio"]:checked + .mode-toggle-btn {
    background: #00d4ff;
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.mode-toggle-btn:hover {
    background: rgba(0, 212, 255, 0.2);
}

.mode-description {
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
    font-style: italic;
}

.synergy-mode-section {
    transition: all 0.3s ease;
}

/* Player Lineups Specific Styles */
.lineup-controls {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.lineup-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #00d4ff;
}

.filter-group select {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #333;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 1rem;
}

.filter-group select[multiple] {
    min-height: 150px;
    padding: 0.5rem;
}

.filter-group select[multiple] option {
    padding: 0.5rem;
    margin: 2px 0;
    border-radius: 4px;
}

.filter-group select[multiple] option:checked {
    background: #00d4ff;
    color: #1a1a2e;
}

.filter-group select:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.filter-help {
    color: #aaa;
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 0.25rem;
}

.lineup-results {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 8px;
}

.lineup-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.lineup-summary .stat-card {
    background: rgba(0, 212, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.lineup-summary .stat-card h4 {
    color: #00d4ff;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.lineup-summary .stat-card p {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e0e0e0;
}

/* Lineup Table Specific Styles */
.lineup-players {
    max-width: 300px;
    word-wrap: break-word;
    font-size: 0.9rem;
}

.maps-cell {
    max-width: 200px;
    word-wrap: break-word;
    font-size: 0.85rem;
    color: #ccc;
}

/* Responsive design for lineup filters */
@media (max-width: 768px) {
    .lineup-filters {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .lineup-summary {
        grid-template-columns: 1fr;
    }
    
    .lineup-players {
        max-width: none;
    }
}

/* Help Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    border: 2px solid #00d4ff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    max-height: 90vh;
    width: 90%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

.modal-header h2 {
    color: #00d4ff;
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: #00d4ff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 212, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.help-section {
    margin-bottom: 2rem;
}

.help-section h3 {
    color: #00d4ff;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
    padding-bottom: 0.5rem;
}

.video-container {
    text-align: center;
    margin-bottom: 1rem;
}

.video-note {
    color: #aaa;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.help-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.help-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    background: #00d4ff;
    color: #1a1a2e;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h4 {
    color: #e0e0e0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.step-content p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.step-content ul {
    color: #ccc;
    padding-left: 1.5rem;
}

.step-content li {
    margin-bottom: 0.3rem;
}

.step-content code {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.feature-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-item h4 {
    color: #00d4ff;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.feature-item p {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.4;
}

.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border-left: 3px solid #00d4ff;
    color: #ccc;
}

.tips-list strong {
    color: #00d4ff;
}

.troubleshooting h4 {
    color: #e0e0e0;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.troubleshooting ul {
    color: #ccc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.troubleshooting li {
    margin-bottom: 0.3rem;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .help-step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        align-self: center;
    }
}

/* Main Application */
header {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #333;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    gap: 2rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.help-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid #00d4ff;
    border-radius: 6px;
    color: #00d4ff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.help-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.help-btn svg {
    flex-shrink: 0;
}

header h1 {
    color: #00d4ff;
    font-size: 1.6rem;
    margin: 0;
}

.team-display {
    color: #00ff88;
    font-weight: bold;
}

/* Clan Selection */
.clan-selection {
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    gap: 2rem;
    flex-wrap: wrap;
}

.clan-controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex: 1;
}

.battle-config {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.battle-config .slider-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.battle-config .slider {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: #333;
    outline: none;
    -webkit-appearance: none;
}

.battle-config .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.battle-config .slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.battle-config .slider-value {
    background: #00d4ff;
    color: #1a1a2e;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    min-width: 22px;
    text-align: center;
    font-size: 0.9rem;
}

.clan-selection label {
    color: #00d4ff;
    font-weight: bold;
}

.clan-selection select {
    padding: 0.5rem;
    border: 2px solid #333;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    cursor: pointer;
}

.clan-selection select:focus {
    outline: none;
    border-color: #00d4ff;
}

/* Data Section */
.data-section {
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #333;
}

.data-section h2 {
    color: #00d4ff;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.8rem;
}

/* Data Upload Steps */
.upload-steps {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.upload-step {
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid #333;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    min-height: 240px;
    display: flex;
    flex-direction: column;
}

.upload-step:hover {
    border-color: #00d4ff;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.1);
}

.step-header {
    background: rgba(0, 212, 255, 0.1);
    padding: 0.6rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
    min-height: 50px;
}

.step-number {
    background: #00d4ff;
    color: #1a1a2e;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.step-header h3 {
    color: #00d4ff;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.3;
    flex: 1;
}

.step-content {
    padding: 0.7rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.step-content p {
    color: #e0e0e0;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    line-height: 1.3;
    flex: 1;
}

.external-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.6rem;
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    border: 1px solid #00ff88;
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.external-link-btn:hover {
    background: linear-gradient(45deg, #00cc6a, #00ff88);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.3);
    text-decoration: none;
    color: white;
}

.external-link-btn svg {
    flex-shrink: 0;
}

.filename-example {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid #00ff88;
    border-radius: 4px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.filename-example strong {
    color: #00ff88;
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
}

.filename-example code {
    background: rgba(0, 0, 0, 0.3);
    color: #00d4ff;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    word-break: break-all;
}

.filename-example small {
    color: #aaa;
    font-style: italic;
    margin-top: 0.2rem;
    display: block;
    font-size: 0.7rem;
}

.step-note {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    color: #ffc107;
    padding: 0.4rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-style: italic;
    font-size: 0.75rem;
}

/* Upload Final Step */
.upload-final-step {
    background: rgba(0, 212, 255, 0.05);
    border: 2px solid #00d4ff;
    border-radius: 12px;
    overflow: hidden;
}

.upload-final-step .step-header {
    background: rgba(0, 212, 255, 0.2);
    border-bottom: 1px solid #00d4ff;
}

.upload-zone {
    padding: 1.5rem;
}

.upload-zone p {
    color: #e0e0e0;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.upload-actions {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.upload-btn {
    flex: 2;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-data-btn {
    flex: 1.2;
}

.upload-btn:hover {
    background: linear-gradient(45deg, #0099cc, #00d4ff);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.3);
}

.upload-tips {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

.upload-tips p {
    color: #00ff88;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.upload-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.upload-tips li {
    color: #ccc;
    padding: 0.3rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.upload-tips li::before {
    content: '✓';
    color: #00ff88;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Enhanced File Input */
#fileUpload {
    width: 100%;
    padding: 1rem;
    border: 2px dashed #00d4ff;
    border-radius: 8px;
    background: rgba(0, 212, 255, 0.05);
    color: #e0e0e0;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#fileUpload:hover {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.05);
}

#fileUpload:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.upload-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
}

.upload-option {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #333;
}

.upload-option h3 {
    color: #00ff88;
    margin-bottom: 0.5rem;
}

.file-tip {
    color: #aaa;
    font-size: 0.85rem;
    margin: 0.5rem 0;
    font-style: italic;
}

.upload-option input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #333;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.upload-option input:focus {
    outline: none;
    border-color: #00d4ff;
}

.upload-option button {
    width: 100%;
    padding: 0.6rem;
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-option button:hover {
    background: linear-gradient(45deg, #00cc6a, #00ff88);
    transform: translateY(-1px);
}

/* Clear Data Button Styling */
.clear-data-btn {
    background: linear-gradient(45deg, #ff5252, #e53935) !important;
    color: white !important;
    border: 1px solid #ff5252 !important;
    transition: all 0.3s ease !important;
}

.clear-data-btn:hover {
    background: linear-gradient(45deg, #e53935, #d32f2f) !important;
    border-color: #e53935 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(255, 82, 82, 0.3) !important;
}

.status {
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 1rem;
    text-align: center;
}

.status.success {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid #00ff88;
}

.status.error {
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
    border: 1px solid #ff5252;
}

.status.loading {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border: 1px solid #00d4ff;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #00d4ff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Navigation */
.analysis-nav {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #333;
    padding: 0 2rem;
}

.nav-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-btn:hover {
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

.nav-btn.active {
    color: #00d4ff;
    border-bottom-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

/* Analysis Views */
.analysis-view {
    display: none;
    padding: 2rem;
    min-height: 50vh;
}

.analysis-view.active {
    display: block;
}

.analysis-view h2 {
    color: #00d4ff;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Strategic Overview */
.strategic-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.insight-card {
    background: rgba(0, 212, 255, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #00d4ff;
    text-align: center;
}

.insight-card h3 {
    color: #00d4ff;
    margin-bottom: 0.5rem;
}

.insight-card p {
    color: #e0e0e0;
    font-size: 1.1rem;
    font-weight: bold;
}

/* Matrix Section */
.matrix-section {
    margin-bottom: 2rem;
}

.matrix-section h3 {
    color: #00ff88;
    margin-bottom: 1rem;
}

.ship-map-matrix {
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.matrix-table th,
.matrix-table td {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #333;
}

.matrix-table th {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    font-weight: bold;
}

.ship-header {
    background: rgba(0, 255, 136, 0.2) !important;
    color: #00ff88 !important;
    font-weight: bold;
    text-align: left !important;
}

.perf-excellent {
    background: rgba(208, 66, 243, 0.3);
    color: #D042F3;
}

.perf-good {
    background: rgba(0, 255, 136, 0.3);
    color: #00ff88;
}

.perf-average {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.perf-poor {
    background: rgba(255, 82, 82, 0.3);
    color: #ff5252;
}

.perf-insufficient {
    background: rgba(128, 128, 128, 0.3);
    color: #888;
}

/* Stats Summary */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(0, 255, 136, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #00ff88;
    text-align: center;
}

.stat-card h3 {
    color: #00ff88;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: #e0e0e0;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Filter Controls */
.filter-controls {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-controls label {
    color: #00d4ff;
    font-weight: bold;
}

.filter-controls select {
    padding: 0.5rem;
    border: 2px solid #333;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    cursor: pointer;
}

.filter-controls select:focus {
    outline: none;
    border-color: #00d4ff;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 2rem;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table-container th,
.table-container td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #333;
}

.table-container th {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.table-container tbody tr:hover {
    background: rgba(0, 212, 255, 0.1);
}

/* Strategic Tables */
.strategic-table {
    margin-bottom: 2rem;
}

.strategic-table table {
    font-size: 0.9rem;
}

.strategic-table th {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

/* Threats Section */
.threats-section,
.duplicate-section {
    margin-bottom: 2rem;
}

.threats-section h3,
.duplicate-section h3 {
    color: #ff5252;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 900px) {
    .upload-steps {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        margin-bottom: 1rem;
        max-width: none;
    }
    
    .upload-step {
        min-height: auto;
        margin-bottom: 0;
    }
    
    .step-header {
        padding: 0.6rem 0.8rem;
        flex-direction: column;
        text-align: center;
        gap: 0.4rem;
    }
    
    .step-number {
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
    }
    
    .step-header h3 {
        font-size: 1rem;
    }
    
    .step-content {
        padding: 0.8rem;
    }
    
    .external-link-btn {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .filename-example {
        padding: 0.6rem;
    }
    
    .filename-example code {
        font-size: 0.75rem;
        word-break: break-all;
    }
    
    .upload-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .upload-btn,
    .clear-data-btn {
        flex: none;
    }
    
    .upload-zone {
        padding: 1rem;
    }
    
    .strategic-insights {
        grid-template-columns: 1fr;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .analysis-nav {
        flex-direction: column;
        padding: 0;
    }
    
    .nav-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .nav-btn.active {
        border-left-color: #00d4ff;
        border-bottom-color: transparent;
    }
    
    .clan-selection {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }
    
    .clan-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
    }
    
    .battle-config {
        align-self: flex-start;
        margin-top: 0.5rem;
    }
    
    .slider {
        width: 100%;
        max-width: none;
    }
}

/* Player Selection */
.player-selection {
    margin-bottom: 1.5rem;
    background: rgba(0, 255, 136, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #00ff88;
}

.player-selection label {
    color: #00ff88;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.player-selection select {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem;
    border: 2px solid #333;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    font-size: 0.9rem;
}

.player-selection select:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.player-selection-help {
    margin-top: 0.5rem;
}

.player-selection-help small {
    color: #888;
    font-style: italic;
}

/* Ship Selection */
.ship-selection {
    margin-bottom: 1.5rem;
    background: rgba(0, 212, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #00d4ff;
}

.ship-selection label {
    color: #00d4ff;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.ship-selection select {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem;
    border: 2px solid #333;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    font-size: 0.9rem;
}

.ship-selection select:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.ship-selection-help {
    margin-top: 0.5rem;
}

.ship-selection-help small {
    color: #888;
    font-style: italic;
}

/* Player Ship Matrix */
.matrix-container {
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
}

.player-matrix-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.player-matrix-table th,
.player-matrix-table td {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #333;
}

.player-matrix-table th {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    font-weight: bold;
}

.ship-name-header {
    background: rgba(0, 255, 136, 0.2) !important;
    color: #00ff88 !important;
    font-weight: bold;
    text-align: left !important;
}

/* Lineup Section */
.lineup-section {
    margin-top: 2rem;
    background: rgba(0, 212, 255, 0.05);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #00d4ff;
}

.lineup-section h3 {
    color: #00d4ff;
    margin-bottom: 1rem;
    text-align: center;
}

/* Player Ship Matrix */
.player-ship-matrix {
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
}

.player-ship-matrix table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.player-ship-matrix th,
.player-ship-matrix td {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #333;
}

.player-ship-matrix th {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    font-weight: bold;
}

/* Lineup Table Styling */
.lineup-table {
    background: rgba(0, 212, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
}

.lineup-table table {
    width: 100%;
    border-collapse: collapse;
}

.lineup-table th {
    background: rgba(0, 212, 255, 0.3);
    color: #00d4ff;
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #00d4ff;
}

.lineup-table td {
    padding: 0.75rem;
    border: 1px solid #333;
    background: rgba(0, 0, 0, 0.1);
}

.lineup-table tbody tr:hover {
    background: rgba(0, 212, 255, 0.1);
}

/* Individual Player Section Enhancements */
#individualPlayerSection {
    margin-top: 1rem;
    padding: 1.5rem;
    background: rgba(0, 255, 136, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 136, 0.1);
}

#singlePlayerMatrix h3 {
    color: #00ff88;
    text-align: center;
    margin-bottom: 1rem;
}

#lineupRecommendations h3 {
    color: #00d4ff;
    text-align: center;
    margin-bottom: 1rem;
}

/* Enhanced Multi-Select Styling */
#playerSelect {
    background: rgba(0, 255, 136, 0.05);
    border: 2px solid #00ff88;
    color: #e0e0e0;
    font-family: inherit;
}

#playerSelect option {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 0.3rem;
}

#playerSelect option:checked {
    background: #00ff88;
    color: #1a1a2e;
}

#playerSelect:focus {
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

/* Enhanced Ship Multi-Select Styling */
#shipSelect {
    background: rgba(0, 212, 255, 0.05);
    border: 2px solid #00d4ff;
    color: #e0e0e0;
    font-family: inherit;
}

#shipSelect option {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 0.3rem;
}

#shipSelect option:checked {
    background: #00d4ff;
    color: #1a1a2e;
}

#shipSelect:focus {
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

/* Individual Ship Section Enhancements */
#individualShipSection {
    margin-top: 1rem;
    padding: 1.5rem;
    background: rgba(0, 212, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.1);
}

#singleShipMatrix h3 {
    color: #00d4ff;
    text-align: center;
    margin-bottom: 1rem;
}

#shipPlayerRecommendations h3 {
    color: #00d4ff;
    text-align: center;
    margin-bottom: 1rem;
}

/* Discord Login Button */
.discord-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(45deg, #5865F2, #4752C4);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.discord-login-btn:hover {
    background: linear-gradient(45deg, #4752C4, #5865F2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.4);
}

.discord-login-btn svg {
    width: 20px;
    height: 20px;
}

.auth-info {
    margin-top: 1rem;
    text-align: center;
}

.auth-info small {
    color: #888;
    font-style: italic;
    line-height: 1.4;
}

/* User Display */
.user-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 255, 136, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #00ff88;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #00ff88;
}

.user-display span {
    color: #00ff88;
    font-weight: bold;
}

.logout-btn {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
    border: 1px solid #ff5252;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 82, 82, 0.3);
    transform: translateY(-1px);
}

/* Upload Section Updates */
.upload-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
}

/* Enhanced Status Animations */
.status.success {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid #00ff88;
    animation: fadeIn 0.3s ease;
}

.status.error {
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
    border: 1px solid #ff5252;
    animation: shake 0.5s ease;
}

.status.loading {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border: 1px solid #00d4ff;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Enhanced Matrix Styling */
.matrix-container p,
.table-container p {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px dashed #333;
}

/* Header Enhancement */
header {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Synergy View Styles */
.synergy-controls {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.synergy-player-selection h3 {
    margin-bottom: 1rem;
    color: #00d4ff;
}

.synergy-player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.synergy-player-checkbox {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.synergy-player-checkbox:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: #00d4ff;
}

.synergy-player-checkbox.selected {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
}

.synergy-player-checkbox input {
    margin-right: 0.5rem;
}

.synergy-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.clear-btn {
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
    border: 1px solid #ff5252;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: rgba(255, 82, 82, 0.3);
}

.player-count {
    color: #888;
    font-size: 0.9rem;
}

.synergy-results {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 8px;
}

.synergy-results h3 {
    margin-bottom: 1rem;
    color: #00d4ff;
}

.synergy-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.synergy-details {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 4px;
    color: #ccc;
}

.synergy-details p {
    margin: 0.5rem 0;
}

/* Table Styling */
.table-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin-top: 1rem;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    color: #e0e0e0;
}

.table-container th {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid #00d4ff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.table-container th:hover {
    background: rgba(0, 212, 255, 0.3);
}

.table-container th.sortable::after {
    content: '↕';
    position: absolute;
    right: 8px;
    opacity: 0.5;
    font-size: 0.8rem;
}

.table-container th.sort-asc::after {
    content: '↑';
    opacity: 1;
    color: #00d4ff;
}

.table-container th.sort-desc::after {
    content: '↓';
    opacity: 1;
    color: #00d4ff;
}

.table-container td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.table-container tr:hover {
    background: rgba(0, 212, 255, 0.1);
}

.table-container tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

/* Performance color coding */
.perf-excellent {
    color: #4caf50;
    font-weight: bold;
}

.perf-good {
    color: #8bc34a;
    font-weight: bold;
}

.perf-average {
    color: #ffc107;
    font-weight: bold;
}

.perf-poor {
    color: #f44336;
    font-weight: bold;
}

.perf-insufficient {
    color: #666;
    font-style: italic;
}

/* Responsive Updates */
@media (max-width: 768px) {
    .user-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        text-align: center;
    }
    
    .user-display span {
        order: -1;
    }
    
    .discord-login-btn {
        min-width: auto;
        width: 100%;
    }
    
    .auth-form {
        min-width: 280px;
    }
    
    header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}
