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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.version-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

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

/* Standings View Toggle */
.standings-view-toggle {
    display: flex;
    gap: 5px;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 8px;
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toggle-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.toggle-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.toggle-btn i {
    font-size: 0.85rem;
}

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

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 25px;
    background: white;
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tab-btn:not(.active):hover {
    background: #f8f9fa;
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* Roster Sections */
.roster-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.position-group {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.position-group h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
    transition: all 0.3s ease;
}

.player-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.player-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.player-details {
    font-size: 0.9rem;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Filters */
.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

/* Table */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
}

th:hover {
    background: #e9ecef;
}

th.sortable {
    position: relative;
}

th.sortable i {
    margin-left: 5px;
    opacity: 0.5;
}

tr:hover {
    background: #f8f9fa;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

/* Teams Grid */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.team-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e1e8ed;
    transition: all 0.3s ease;
}

.team-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.team-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.team-record {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Loading Spinner */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-container {
    width: 400px;
    margin: 20px auto;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

#progress-text {
    color: white;
    font-size: 14px;
    margin: 0;
}

/* Error Messages */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.3);
    z-index: 1001;
    max-width: 400px;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-content button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
}

/* Success Messages */
.success {
    color: #28a745;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Auth Steps */
.auth-step {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.auth-step h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-step p {
    color: #6c757d;
    margin-bottom: 15px;
}

.form-group small {
    display: block;
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Export Data Styles */
.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.export-option {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.export-option:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.export-option h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.export-option p {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.export-status {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.status-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #1976d2;
    font-weight: 600;
}

.status-content.success {
    color: #388e3c;
}

.status-content.error {
    color: #d32f2f;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        justify-content: flex-start;
    }
    
    .filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .roster-sections {
        grid-template-columns: 1fr;
    }
    
    .teams-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 10px;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 25px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
}

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

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
}

/* Scrollbar styling for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Dashboard Styles */
.matchup-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    margin: 15px 0;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.matchup-card.user-matchup {
    background: linear-gradient(135deg, #f3f0ff 0%, #e8e3ff 100%);
    border-color: #667eea;
}

.matchup-team {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.matchup-team.user-team {
    background: rgba(102, 126, 234, 0.1);
    padding: 10px;
    border-radius: 6px;
}

.team-info {
    flex: 1;
}

.team-name {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.team-record {
    font-size: 0.9rem;
    color: #666;
}

.team-score {
    text-align: center;
    min-width: 80px;
}

.score {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.projected {
    font-size: 0.85rem;
    color: #888;
}

.matchup-vs {
    font-weight: bold;
    font-size: 1.2rem;
    color: #999;
    padding: 0 15px;
}

.featured-matchup h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.all-matchups h3 {
    margin-bottom: 15px;
    color: #333;
}

/* Standings Table */
.standings-table {
    margin-bottom: 30px;
}

.standings-table h3 {
    margin-bottom: 15px;
    color: #667eea;
}

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

.standings-table th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.standings-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.standings-table tr:hover {
    background: #f8f9fa;
}

.user-team-row {
    background: linear-gradient(135deg, #f3f0ff 0%, #e8e3ff 100%);
    font-weight: 500;
}

.user-team-row:hover {
    background: linear-gradient(135deg, #ece7ff 0%, #ddd8ff 100%);
}

.you-badge {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

@media (max-width: 768px) {
    .matchup-card {
        flex-direction: column;
        gap: 15px;
    }
    
    .matchup-team {
        width: 100%;
        justify-content: space-between;
    }
    
    .matchup-vs {
        transform: rotate(90deg);
    }
}

/* Matchup Analyzer Styles */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.category-card {
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: white;
}

.category-card.winning {
    border-color: #4caf50;
    background: linear-gradient(135deg, #f0fff0 0%, #e8ffe8 100%);
}

.category-card.losing {
    border-color: #f44336;
    background: linear-gradient(135deg, #fff0f0 0%, #ffe8e8 100%);
}

.category-card.tied {
    border-color: #ff9800;
    background: linear-gradient(135deg, #fff8f0 0%, #fff0e8 100%);
}

.category-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 10px;
    text-align: center;
}

.category-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.my-stat, .opp-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.my-stat .label, .opp-stat .label {
    font-size: 0.85rem;
    color: #666;
}

.my-stat .value, .opp-stat .value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
}

.diff {
    font-size: 1.1rem;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
}

.diff.winning {
    color: #4caf50;
}

.diff.losing {
    color: #f44336;
}

.diff.tied {
    color: #ff9800;
}

.players-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.team-players h4 {
    color: #667eea;
    margin-bottom: 10px;
}

.player-list-compact {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.player-item {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.player-name {
    font-weight: 500;
}

.player-pos {
    font-size: 0.9rem;
    color: #666;
}

.recommendations-box {
    margin: 20px 0;
}

.summary-box, .advice-box, .note-box {
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
}

.summary-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #d1e7ff 100%);
    border-left: 4px solid #2196f3;
}

.advice-box {
    background: linear-gradient(135deg, #f3f0ff 0%, #e8e3ff 100%);
    border-left: 4px solid #667eea;
}

.advice-box ul {
    margin: 10px 0;
    padding-left: 20px;
}

.advice-box li {
    margin: 8px 0;
}

.note-box {
    background: #fffbf0;
    border-left: 4px solid #ff9800;
}

@media (max-width: 768px) {
    .players-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
}

/* AI Analysis Styles */
.ai-intro {
    color: #666;
    font-size: 1rem;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.ai-config {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.ai-analysis-content {
    line-height: 1.8;
    font-size: 1.05rem;
}

.ai-analysis-content h1 {
    color: #667eea;
    font-size: 1.8rem;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.ai-analysis-content h2 {
    color: #764ba2;
    font-size: 1.5rem;
    margin-top: 25px;
    margin-bottom: 12px;
}

.ai-analysis-content h3 {
    color: #333;
    font-size: 1.2rem;
    margin-top: 20px;
    margin-bottom: 10px;
}

.ai-analysis-content p {
    margin: 15px 0;
    color: #333;
}

.ai-analysis-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.ai-analysis-content li {
    margin: 8px 0;
    color: #333;
}

.ai-analysis-content strong {
    color: #667eea;
    font-weight: 600;
}

.ai-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
    color: #888;
}

.ai-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ai-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #667eea;
}

.ai-table td {
    padding: 12px;
    border: 1px solid #e0e0e0;
}

.ai-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.ai-table tbody tr:hover {
    background: #f0f0f0;
}

.ai-analysis-content ol {
    counter-reset: item;
    list-style-type: none;
    padding-left: 25px;
}

.ai-analysis-content ol li {
    counter-increment: item;
    margin: 12px 0;
}

.ai-analysis-content ol li::before {
    content: counter(item) ". ";
    font-weight: bold;
    color: #667eea;
    margin-right: 5px;
}

/* Team Ranking Styles */
.team-ranking-content {
    line-height: 1.8;
    font-size: 1.05rem;
}

.team-ranking-content h1 {
    color: #667eea;
    font-size: 1.8rem;
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.team-ranking-content h2 {
    color: #764ba2;
    font-size: 1.5rem;
    margin-top: 20px;
    margin-bottom: 12px;
}

.team-ranking-content h3 {
    color: #333;
    font-size: 1.2rem;
    margin-top: 15px;
    margin-bottom: 10px;
}

.team-ranking-content ol {
    list-style-type: decimal;
    padding-left: 30px;
    margin: 15px 0;
}

.team-ranking-content ol li {
    margin: 10px 0;
    padding-left: 5px;
}

.team-ranking-content ul {
    list-style-type: disc;
    padding-left: 30px;
    margin: 15px 0;
}

.team-ranking-content ul li {
    margin: 8px 0;
}

.ranking-table {
    margin: 20px 0;
}

.ranking-table td:nth-child(5) {
    text-align: center;
    font-weight: bold;
}

#team-ranking-results {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #667eea;
}

#rank-my-team-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

#rank-my-team-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#rank-my-team-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Team Ranking Comparison Styles */
.team-ranking-comparison {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    color: white;
}

.team-ranking-comparison h2 {
    color: white;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.ranking-scores {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.team-score {
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.team-score.winning {
    background: rgba(255, 255, 255, 0.25);
    border: 3px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.team-score h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.score-circle {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    margin: 10px 0;
}

.score-circle span {
    font-size: 1.5rem;
    opacity: 0.8;
}

.score-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-top: 10px;
}

.score-difference {
    flex: 0.5;
    text-align: center;
}

.vs {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
}

.advantage {
    color: white;
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 15px;
    border-radius: 8px;
}

.advantage strong {
    color: #ffd700;
    font-size: 1.3rem;
}

/* Modal Styles */
.modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #fefefe;
    margin: 3% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 1200px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-close {
    position: sticky;
    top: 0;
    right: 0;
    float: right;
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    background: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover,
.modal-close:focus {
    color: #667eea;
    background: #f0f0f0;
}

#modal-team-name {
    color: #667eea;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

#modal-ranking-content {
    margin-top: 20px;
}

.clickable-team-name:hover {
    color: #ffd700 !important;
    transform: scale(1.05);
    transition: all 0.3s;
}

/* NHL Lineup Position Badges */
.lineup-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 5px;
    text-transform: uppercase;
}

.badge-elite {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge-good {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.badge-average {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.badge-weak {
    background: #e0e0e0;
    color: #666;
}

.badge-pp1 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
    font-weight: 700;
}

.badge-pp2 {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.lineup-info {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* Lifecycle Stage Badges */
.lifecycle-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.lifecycle-badge i {
    font-size: 0.9rem;
}

.lifecycle-contender {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.lifecycle-playoff-lock {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.lifecycle-competitive {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: #1a1a1a;
}

.lifecycle-retooling {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #1a1a1a;
}

.lifecycle-rebuilding {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.lifecycle-dynasty-mode {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3436;
}

/* Expected Ranking Badge */
.ranking-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: inherit;
    backdrop-filter: blur(10px);
}

/* Team Badge Container */
.team-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.team-card .team-badges {
    margin-top: 12px;
}

/* Standings Badge - Compact Version */
.standings-lifecycle-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-left: 8px;
}

/* Modal/Detail View Badge - Large Version */
.detail-lifecycle-badge {
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: 16px;
}

.detail-ranking-badge {
    font-size: 0.75rem;
    padding: 4px 12px;
}

/* AI Chat Assistant Styles */
#chat-header {
    transition: all 0.3s ease;
}

#chat-header:hover {
    background: #f8f9fa;
    border-radius: 8px;
    margin: -10px;
    padding: 10px;
}

.example-question-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-question-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.chat-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}

.chat-message.user {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.chat-message.assistant {
    background: #f3e5f5;
    border-left: 4px solid #667eea;
}

.chat-message.thinking {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-message strong {
    display: block;
    margin-bottom: 5px;
}

.chat-message p {
    margin: 0;
    line-height: 1.5;
    white-space: pre-wrap;
}

#chat-messages::-webkit-scrollbar {
    width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

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