/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.2rem;
    font-weight: 300;
}

/* Navigation */
.nav-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #7f8c8d;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.info-grid {
    display: grid;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
}

.label {
    font-weight: 600;
    color: #34495e;
}

.value {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
}

.prize-breakdown {
    display: grid;
    gap: 12px;
}

.prize-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

#currentLeader {
    text-align: center;
    padding: 20px;
}

.leader-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.leader-score {
    font-size: 2rem;
    font-weight: 800;
    color: #667eea;
}

/* Upload */
.upload-area {
    border: 2px dashed #bdc3c7;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

#fileInput {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Forms */
.results-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
}

select, input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

select:focus, input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Teams Grid */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.team-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid;
    transition: transform 0.2s ease;
}

.team-card:hover {
    transform: translateY(-2px);
}

.team-card.two-point {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(231, 76, 60, 0.05));
}

.team-card.one-point {
    border-left-color: #3498db;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(52, 152, 219, 0.05));
}

.team-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.team-points {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Point Badges */
.point-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    margin-right: 10px;
}

.two-point {
    background: #e74c3c;
}

.one-point {
    background: #3498db;
}

/* Teams Legend */
.teams-legend {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #34495e;
}

/* Standings Table */
.standings-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 40px;
}

/* Team Results Grid */
.team-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.team-result-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.team-result-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #34495e;
}

.result-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.result-controls button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.win-btn {
    background: #27ae60;
    color: white;
}

.loss-btn {
    background: #e74c3c;
    color: white;
}

.win-btn:hover {
    background: #229954;
}

.loss-btn:hover {
    background: #c0392b;
}

.win-btn.active {
    background: #1e8449;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.loss-btn.active {
    background: #a93226;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* Status Messages */
.status-message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: 600;
}

.status-message.success {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.status-message.error {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Admin Login */
.admin-login-section {
    text-align: center;
    margin-bottom: 30px;
}

.admin-login-form {
    max-width: 400px;
    margin: 0 auto;
}

.admin-login-form p {
    margin-bottom: 20px;
    color: #666;
}

.admin-panel-content {
    margin-top: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.admin-nav-btn {
    margin-right: 10px;
}

.admin-only {
    display: none !important;
}

.admin-logged-in .admin-only {
    display: flex !important;
}

/* Smack Talk Board */
.smack-talk-board {
    margin-top: 30px;
}

.smack-talk-form {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.smack-talk-form .form-group {
    display: grid;
    gap: 15px;
}

.smack-talk-form input,
.smack-talk-form textarea {
    width: 100%;
}

.smack-talk-form textarea {
    resize: vertical;
    min-height: 80px;
}

.smack-talk-messages {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.smack-talk-message {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.smack-talk-message:last-child {
    margin-bottom: 0;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.message-author {
    font-weight: 700;
    color: #2c3e50;
}

.message-time {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.message-content {
    color: #34495e;
    line-height: 1.4;
}

.no-messages {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 40px;
}

/* Entry Security */
.entry-codes-display {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    max-height: 300px;
    overflow-y: auto;
}

.entry-code-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
}

.entry-code-name {
    font-weight: 600;
    color: #2c3e50;
}

.entry-code-value {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #667eea;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Footer */
.site-footer {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 20px;
    margin-top: 30px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.footer-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.footer-content a:hover {
    text-decoration: underline;
}

/* Admin Panel */
.admin-section {
    margin-bottom: 30px;
}

.admin-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pending-switches, .switch-history {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.switch-request-item {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.switch-history-item {
    background: rgba(39, 174, 96, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #27ae60;
}

.switch-history-item.denied {
    background: rgba(231, 76, 60, 0.1);
    border-left-color: #e74c3c;
}

.switch-request-details {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

.switch-request-actions {
    display: flex;
    gap: 10px;
}

.btn-approve {
    background: #27ae60;
    color: white;
}

.btn-deny {
    background: #e74c3c;
    color: white;
}

/* Team Division Layout */
.division-section {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.division-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.division-teams {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.team-record {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.record-badge {
    background: #34495e;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.record-badge.winning {
    background: #27ae60;
}

.record-badge.losing {
    background: #e74c3c;
}

/* Team Switching */
.switching-rules {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.rule-icon {
    font-size: 1.5rem;
    margin-top: 5px;
}

.switching-form {
    max-width: 600px;
}

.player-teams-display {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.player-teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.player-team-item {
    padding: 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}

.switching-interface {
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    margin-top: 20px;
}

.switch-selection {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.validation-display {
    padding: 15px;
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.3);
    border-radius: 8px;
    color: #27ae60;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.validation-display.warning {
    background: rgba(243, 156, 18, 0.1);
    border-color: rgba(243, 156, 18, 0.3);
    color: #f39c12;
}

.validation-display.error {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.validation-display.success {
    background: rgba(39, 174, 96, 0.1);
    border-color: rgba(39, 174, 96, 0.3);
    color: #27ae60;
}

.switch-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.switch-btn:hover {
    background: #e67e22;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        margin-bottom: 5px;
    }
    
    .teams-grid {
        grid-template-columns: 1fr;
    }
    
    .teams-legend {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 8px 6px;
    }

    .switching-rules {
        grid-template-columns: 1fr;
    }
    
    .rule-item {
        flex-direction: column;
        text-align: center;
    }
    
    .switch-selection {
        grid-template-columns: 1fr;
    }
}

/* Admin Override Modal */
.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;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.override-form {
    display: grid;
    gap: 20px;
}

.override-form .form-group {
    display: grid;
    gap: 8px;
}

.override-form label {
    font-weight: 600;
    color: #2c3e50;
}

.override-form select,
.override-form input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.picks-editor {
    display: grid;
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.pick-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.pick-team {
    font-weight: 600;
    color: #2c3e50;
}

.pick-remove {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.pick-remove:hover {
    background: #c0392b;
}

.add-pick {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.add-pick select {
    flex: 1;
}

.add-pick button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
}

.add-pick button:hover {
    background: #229954;
}

.code-export-area {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}