/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Navigation */
nav {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 0.75rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: #3498db;
}

/* Language selector */
.language-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.language-selector a {
    font-size: 1.5rem;
    opacity: 0.6;
    transition: opacity 0.3s;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    line-height: 1; /* Prevent emoji flags from affecting vertical alignment */
}

.language-selector a:hover {
    opacity: 1;
}

.language-selector a.active {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Admin Navigation */
.admin-nav {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 0.5rem 0;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.admin-nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
}

.admin-nav a:hover {
    background: rgba(102, 126, 234, 0.2);
    color: white;
}

.admin-nav a.active {
    background: #667eea;
    color: white;
}

/* Main content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 2rem;
    color: #2c3e50;
}

/* Sections */
.section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3,
.stat-card h4 {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.stat-success {
    border-top: 4px solid #27ae60;
}

.stat-warning {
    border-top: 4px solid #f39c12;
}

.stat-error {
    border-top: 4px solid #e74c3c;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #ecf0f1;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

/* Past game table row styling */
tbody tr.past-game {
    background-color: #f8f9fa;
    opacity: 0.85;
}

tbody tr.past-game:hover {
    opacity: 1;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-error {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.badge-secondary {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Forms */
.form-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Info cards */
.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.info-card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.info-card p {
    margin-bottom: 0.5rem;
}

/* Player Header Hero Section */
.player-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 0; /* Full-width hero - no rounded corners */
    margin-bottom: 0; /* Flush connection with content below */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.player-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.player-header > * {
    position: relative;
    z-index: 1;
}

.player-header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.player-header p {
    margin: 0.75rem 0 0 0;
    opacity: 0.95;
    font-size: 1.1rem;
    font-weight: 400;
}

.player-meta {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.85;
}

.player-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-info,
.player-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Quick actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
    font-style: italic;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 3rem;
}

footer p {
    margin: 0;
}

.dev-info {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: monospace;
}

.dev-info code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

/* Games List - Mobile Cards */
.games-cards {
    display: none; /* Hidden by default, shown on mobile */
}

.game-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.game-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Past game styling */
.game-card.past-game {
    background: #f8f9fa;
    opacity: 0.85;
}

.game-card.past-game:hover {
    opacity: 1;
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.game-date {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.game-location-badge {
    font-size: 14px;
    padding: 4px 12px;
    white-space: nowrap;
}

.game-matchup {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
}

.game-time-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.game-time {
    font-size: 14px;
    color: #555;
}

.game-season {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 12px;
}

.game-card-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    text-align: center;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    min-height: 44px; /* Minimum touch target */
}

/* Players List - Mobile Cards */
.players-cards {
    display: none; /* Hidden by default, shown on mobile */
}

.player-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.player-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.player-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.player-number {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.player-status-badge {
    font-size: 14px;
    padding: 4px 12px;
    white-space: nowrap;
}

.player-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.3;
}

.player-email {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 12px;
    word-break: break-word;
}

.player-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-card-btn {
    width: 100%;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    min-height: 40px;
}

.player-view-btn {
    background-color: #9b59b6;
}

.player-view-btn:hover {
    background-color: #8e44ad;
}

.player-injury-form {
    width: 100%;
}

.player-injury-form .player-card-btn {
    width: 100%;
}

/* Dashboard Games Cards (reuse game card styles) */
.dashboard-games-cards {
    display: none; /* Hidden by default, shown on mobile */
}

/* Responsive */
@media (max-width: 768px) {
    /* Hide tables on mobile, show cards */
    .games-table {
        display: none;
    }

    .games-cards {
        display: block;
    }

    .players-table {
        display: none;
    }

    .players-cards {
        display: block;
    }

    .dashboard-games-table {
        display: none;
    }

    .dashboard-games-cards {
        display: block;
    }

    /* Optimize nav for mobile */
    nav {
        padding: 0.5rem 0;
    }

    nav .container {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0 15px;
    }

    nav ul {
        gap: 0.5rem;
    }

    nav h1 {
        font-size: 1.1rem;
    }

    .admin-nav {
        padding: 0.4rem 0;
    }

    .admin-nav-container {
        gap: 0.5rem;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding: 0 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-nav a {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
        white-space: nowrap;
    }

    /* Make page header more compact */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }

    .page-header .btn {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
    }

    /* Optimize section spacing on mobile */
    .section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    main {
        padding: 1rem 0;
    }

    .container {
        padding: 0 15px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.5rem;
    }

    .player-header {
        padding: 2rem 1.5rem;
    }

    .player-header h1 {
        font-size: 1.75rem;
    }

    .player-header p {
        font-size: 1rem;
    }

    .player-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Player view tablet responsive styles */
    .player-view-game-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .player-view-game-title {
        font-size: 1.25rem;
    }

    .player-view-game-meta {
        text-align: right;
        justify-content: flex-end;
    }
}

/* Player View Specific Styles */
/* Game card styles for player view */
.player-view-game-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.player-view-game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.player-view-game-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.player-view-game-title {
    font-size: 1.15rem;
    font-weight: bold;
    color: #2c3e50;
}

.player-view-game-meta {
    font-size: 0.85rem;
    color: #7f8c8d;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.player-view-game-card .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
}

.player-view-game-card .badge-success {
    background-color: #d4edda;
    color: #155724;
}

.player-view-game-card .badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.copy-link-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.copy-link-btn:hover {
    background: #2980b9;
}

.copy-link-btn:active {
    transform: scale(0.98);
}

.copy-link-btn.copy-success {
    background: #27ae60;
}

.copy-link-btn.copy-error {
    background: #e74c3c;
}

/* Attendance summary grid */
.attendance-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.summary-item {
    text-align: center;
    padding: 0.5rem 0.25rem;
}

.summary-count {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
}

.summary-label {
    font-size: 0.75rem;
    color: #7f8c8d;
    display: block;
    margin-top: 0.25rem;
    line-height: 1.2;
}

/* Average height display */
.average-height-display {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: #e8f5e9;
    border-left: 4px solid #27ae60;
    border-radius: 4px;
}

.average-height-display strong {
    color: #2c3e50;
}

.average-height-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #27ae60;
    margin-left: 0.5rem;
}

/* Your status section */
.your-status {
    margin: 1rem 0;
    padding: 1rem;
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

.your-status strong {
    color: #2c3e50;
}

/* Attendance form */
.attendance-form {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

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

/* Quick action buttons */
.quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quick-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-btn-yes {
    background: #27ae60;
    color: white;
}

.quick-btn-yes:hover {
    background: #229954;
}

.quick-btn-no {
    background: #e74c3c;
    color: white;
}

.quick-btn-no:hover {
    background: #c0392b;
}

.quick-btn-maybe {
    background: #f39c12;
    color: white;
}

.quick-btn-maybe:hover {
    background: #d68910;
}

.quick-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quick-btn:disabled:hover {
    background: inherit;
}

/* All players attendance section */
.all-players-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.all-players-section h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1rem;
}

.status-group {
    margin-bottom: 1rem;
}

.status-group:last-child {
    margin-bottom: 0;
}

.status-header {
    font-weight: bold;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
}

.status-header-attending {
    color: #27ae60;
    border-bottom: 2px solid #27ae60;
}

.status-header-maybe {
    color: #f39c12;
    border-bottom: 2px solid #f39c12;
}

.status-header-not-attending {
    color: #e74c3c;
    border-bottom: 2px solid #e74c3c;
}

.status-header-no-response {
    color: #95a5a6;
    border-bottom: 2px solid #95a5a6;
}

.player-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.player-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s;
}

.player-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.player-tag-attending {
    background: #d4edda;
    color: #155724;
}

.player-tag-maybe {
    background: #fff3cd;
    color: #856404;
}

.player-tag-not-attending {
    background: #f8d7da;
    color: #721c24;
}

.player-tag-no-response {
    background: #e2e3e5;
    color: #383d41;
}

.player-tag-reason {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #95a5a6;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Extra small devices */
@media (max-width: 480px) {
    nav h1 {
        font-size: 1rem;
    }

    .game-date {
        font-size: 16px;
    }

    .game-matchup {
        font-size: 15px;
    }

    .player-header {
        padding: 1.5rem 1rem;
    }

    .player-header h1 {
        font-size: 1.5rem;
    }

    .player-header p {
        font-size: 0.95rem;
    }

    /* Player view responsive styles */
    .attendance-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .summary-count {
        font-size: 1.25rem;
    }

    .summary-label {
        font-size: 0.7rem;
    }

    .player-view-game-card {
        padding: 1rem;
    }

    .quick-actions {
        flex-wrap: wrap;
    }

    .quick-btn {
        flex: 1;
        min-width: 80px;
        padding: 0.5rem 0.4rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        min-width: 100%;
    }
}

/* iPhone SE and very small devices (320px) */
@media (max-width: 360px) {
    .container {
        padding: 0 12px;
    }

    .section {
        padding: 0.75rem;
    }

    .game-card {
        padding: 12px;
    }

    .game-date {
        font-size: 15px;
    }

    .game-matchup {
        font-size: 14px;
    }

    .game-location-badge {
        font-size: 12px;
        padding: 3px 10px;
    }

    nav h1 {
        font-size: 0.9rem;
    }

    .language-selector a {
        font-size: 1.2rem;
        padding: 0.2rem 0.3rem;
    }
}

