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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f8fafc;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* Header Styles */
header {
    background: #1a1a1a;
    color: white;
    text-align: center;
    padding: 40px 20px;
    border-bottom: 4px solid #334155;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

header p {
    max-width: 600px;
    margin: 0 auto;
}

header h1 i {
    margin-right: 15px;
    color: #f59e0b;
}

/* Authentication Styles */
.auth-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #007acc;
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
}

.auth-user {
    font-weight: 500;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-toggle-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.logout-btn {
    color: white;
    text-decoration: none;
    padding: 5px 15px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.1);
}

.login-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    padding: 40px 20px;
}



.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #1FA2E6;
    color: white;
    text-decoration: none;
    padding: 18px 40px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    margin-top: 30px;
    border: 2px solid #1FA2E6;
}

.login-btn:hover {
    background: #1B8BC4;
    border-color: #1B8BC4;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(31, 162, 230, 0.3);
}

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

/* Main Content */
main {
    padding: 40px;
}

section {
    margin-bottom: 40px;
}

h2 {
    color: #1a1a1a;
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Configuration Section */
.config-section {
    background: #f8fbff;
    padding: 30px;
    border-radius: 12px;
    border: 2px solid #cce7ff;
    margin-bottom: 30px;
}

/* Configuration Layout */
.config-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
    align-items: end;
}

.config-row:first-of-type {
    grid-template-columns: 2fr 1fr;
}

/* Logo Upload Section */
.logo-upload-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 8px;
    border: 1px solid #b3d9ff;
}

.file-input {
    padding: 8px;
    border: 2px solid #b3d9ff;
    border-radius: 6px;
    width: 100%;
    margin-bottom: 10px;
    font-family: inherit;
}

.file-input:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.1);
}

.logo-preview {
    display: none;
    text-align: center;
    margin-top: 15px;
}

.logo-image {
    max-width: 80px;
    max-height: 80px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
}

.logo-preview-text {
    font-size: 12px;
    color: #666;
    margin: 5px 0 0 0;
}

.config-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.config-actions {
    margin-top: 25px;
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.league-status {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
}

.league-status.configured {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.league-status.not-configured {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Import/Export Controls */
.import-export-controls {
    display: flex;
    gap: 10px;
}

/* Outline/Ghost Buttons - Brand Blue */
.btn-outline {
    background: transparent;
    border: 2px solid #007acc;
    color: #007acc;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-outline:hover:not(:disabled) {
    background: #007acc;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 204, 0.2);
}

/* Import Section */
.import-section {
    background: #f0f8ff;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #b3d9ff;
    margin-bottom: 25px;
}

.import-section h3 {
    margin-bottom: 10px;
    color: #005a99;
    font-size: 1.2rem;
}

.import-section p {
    margin-bottom: 15px;
    color: #005a99;
    font-size: 0.9rem;
}

#import-text {
    width: 100%;
    padding: 15px;
    border: 2px solid #b3d9ff;
    border-radius: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 15px;
}

#import-text:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.1);
}

.import-options {
    margin-bottom: 20px;
}

.file-upload-area {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    border: 2px dashed #b3d9ff;
    border-radius: 8px;
    background: #f8fbff;
}

.file-name {
    font-style: italic;
    color: #005a99;
    font-size: 0.9rem;
}

.import-divider {
    text-align: center;
    margin: 15px 0;
    font-weight: 600;
    color: #6c757d;
    position: relative;
}

.import-divider::before,
.import-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #dee2e6;
}

.import-divider::before {
    left: 0;
}

.import-divider::after {
    right: 0;
}

.import-controls {
    display: flex;
    gap: 15px;
}

/* Team Names Section */
.team-names-section {
    background: #fff8e1;
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #ffecb3;
    margin-bottom: 30px;
}

.team-names-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.team-name-input {
    display: flex;
    flex-direction: column;
}

.team-name-input label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #f57f17;
}

.team-name-input input {
    padding: 10px 12px;
    border: 2px solid #ffcc02;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
}

.team-name-input input:focus {
    outline: none;
    border-color: #ff8f00;
    box-shadow: 0 0 0 2px rgba(255, 143, 0, 0.1);
}

/* Player Form Styles */
.player-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #e9ecef;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.1);
}

/* Clean Button System - Rosterfuel Brand Colors */
.btn {
    padding: 12px 24px;
    border: 2px solid transparent;
    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;
    background: #007acc;
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary Action Buttons - Main Brand Blue */
.btn-primary {
    background: #007acc;
    color: white;
    border-color: #007acc;
}

.btn-primary:hover:not(:disabled) {
    background: #005a99;
    border-color: #005a99;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 204, 0.3);
}

/* Success/Important Actions - Slightly Larger */
.btn-success {
    background: #1FA2E6;
    color: white;
    border-color: #1FA2E6;
    font-size: 1.1rem;
    padding: 15px 30px;
}

.btn-success:hover:not(:disabled) {
    background: #1B8BC4;
    border-color: #1B8BC4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(31, 162, 230, 0.3);
}

/* Secondary Actions - Neutral Gray */
.btn-secondary {
    background: #64748b;
    color: white;
    border-color: #64748b;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
    border-color: #475569;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 116, 139, 0.2);
}

/* Destructive Actions - Red */
.btn-danger {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.2);
}

/* Players Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.players-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.player-count {
    background: #f8fbff;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    color: #007acc;
    border: 2px solid #cce7ff;
    font-size: 0.95rem;
}

/* Special button overrides inherit from base classes */
#toggle-players-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

#clear-players-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.players-list {
    min-height: 100px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.player-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.player-item:hover {
    border-color: #64748b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.skill-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-select {
    padding: 6px 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.skill-select:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.1);
}

.default-skill-indicator {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: help;
}

.player-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1a1a1a;
}

.skill-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.skill-1 { background: #1a1a1a; }
.skill-2 { background: #374151; }
.skill-3 { background: #6b7280; }
.skill-4 { background: #9ca3af; }

/* Team Generation */
.generation-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.error-message {
    background: #fef2f2;
    color: #991b1b;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    text-align: center;
    font-weight: 600;
}

/* Schedule Display */
.schedule-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f0f9ff;
    border-radius: 10px;
    color: #0c4a6e;
    font-weight: 600;
    border: 1px solid #bae6fd;
}

.schedule-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.week-display {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1a1a1a;
    min-width: 120px;
    text-align: center;
}

.schedule-export {
    border-top: 2px solid #e9ecef;
    padding-top: 20px;
}

/* Teams Display */
.teams-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #e8f5e8;
    border-radius: 10px;
    color: #155724;
    font-weight: 600;
}

.teams-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.team-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.team-card { border-color: #007acc; }

.team-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.team-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 5px;
}

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

.team-players {
    list-style: none;
}

.team-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f8f9fa;
}

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

.team-player-name {
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
}

.team-skill-editor {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-skill-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
    color: #495057;
    cursor: pointer;
    min-width: 120px;
}

.team-skill-select:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.1);
}

.team-skill-select:hover {
    border-color: #bbb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .config-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .config-row:first-of-type {
        grid-template-columns: 1fr;
    }
    
    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .players-header-controls {
        margin-top: 10px;
    }

    main {
        padding: 20px;
    }



    .player-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .team-names-container {
        grid-template-columns: 1fr;
    }

    .import-export-controls {
        flex-direction: column;
        width: 100%;
    }

    .import-export-controls .btn {
        width: 100%;
    }

    header h1 {
        font-size: 2rem;
    }

    .teams-container {
        grid-template-columns: 1fr;
    }

    .generation-controls {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    header {
        padding: 30px 15px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    main {
        padding: 15px;
    }

    .player-form {
        padding: 20px;
    }
}

/* Animation for team generation */
.team-card {
    animation: slideInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.team-card:nth-child(1) { animation-delay: 0.1s; }
.team-card:nth-child(2) { animation-delay: 0.2s; }
.team-card:nth-child(3) { animation-delay: 0.3s; }
.team-card:nth-child(4) { animation-delay: 0.4s; }
.team-card:nth-child(5) { animation-delay: 0.5s; }
.team-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal h3 {
    margin-bottom: 20px;
    color: #007acc;
    font-size: 1.5rem;
}

.share-option {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.share-option h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1rem;
}

.share-link-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.share-link-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
}

#qr-code-container {
    text-align: center;
    margin-bottom: 15px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.modal-actions {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Button Styles for New Features */
/* Button Size Modifiers */
.btn.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

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

.btn.btn-extra-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Button Width Modifiers */
.btn.btn-full-width {
    width: 100%;
    justify-content: center;
}

.btn.btn-auto-width {
    width: auto;
}

/* Remove redundant btn-info - use btn-primary instead */

/* Admin Section Styles */
.admin-section {
    padding: 40px;
    min-height: 80vh;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.admin-header h2 {
    color: #1a1a1a;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.admin-content {
    max-width: 1000px;
}

.admin-panel {
    background: #f8fbff;
    padding: 30px;
    border-radius: 12px;
    border: 2px solid #cce7ff;
}

.admin-panel h3 {
    color: #1a1a1a;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.admin-description {
    color: #64748b;
    margin-bottom: 25px;
    line-height: 1.6;
}

.add-email-form {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

.form-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #64748b;
    white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.authorized-emails-list {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.email-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
}

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

.email-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.email-address {
    font-weight: 500;
    color: #1a1a1a;
}

.email-meta {
    font-size: 0.85rem;
    color: #64748b;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f59e0b;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 10px;
}

.email-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.loading-spinner {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.loading-spinner i {
    font-size: 1.5rem;
    margin-right: 10px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #cbd5e1;
}

/* Admin Toggle Button */
.admin-toggle-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Responsive Design for Admin */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .email-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .email-actions {
        align-self: flex-end;
    }
}
