/* Coach Reporting System Styles */

/* Global Loading State */
body.loading {
    cursor: wait;
}

body.loading * {
    pointer-events: none;
}

/* General Form Styles */
.coach-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.coach-form h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-group input.error {
    border-color: #dc3545;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

/* Buttons */
.coach-btn {
    background: #007cba;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.coach-btn:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-1px);
}

.coach-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.coach-btn-secondary {
    background: #6c757d;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin-left: 10px;
}

.coach-btn-secondary:hover:not(:disabled) {
    background: #545b62;
}

/* Messages */
.coach-messages {
    margin-top: 20px;
}

.coach-success {
    background: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 15px;
}

.coach-error {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 15px;
}

.coach-notice {
    background: #d1ecf1;
    border: 2px solid #bee5eb;
    color: #0c5460;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* Login Container */
.coach-login-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 20px;
}

/* Dashboard Styles */
.coach-dashboard-container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
}

.coach-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #007cba;
}

.coach-header h2 {
    margin: 0;
    color: #333;
}

.coach-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.coach-logout {
    color: #dc3545;
    text-decoration: none;
    font-weight: 600;
}

.coach-logout:hover {
    text-decoration: underline;
}

.coach-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Games Section */
.games-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.games-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.games-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-card {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.game-card.upcoming {
    border-left-color: #28a745;
    background: #f8fff9;
}

.game-card.completed {
    border-left-color: #6c757d;
    background: #f8f9fa;
}

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

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.game-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.game-date {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.game-status {
    margin-top: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.game-status.completed {
    background: #d4edda;
    color: #155724;
}

.game-actions {
    margin-top: 10px;
}

.report-score-btn {
    background: #28a745;
    padding: 8px 16px;
    font-size: 14px;
}

.report-score-btn:hover {
    background: #218838;
}

/* Report Section */
.report-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.report-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

#game-details h4 {
    background: #e9ecef;
    padding: 15px;
    border-radius: 6px;
    margin: 0 0 20px 0;
    color: #495057;
}

.score-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.team-name {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-weight: 600;
}

/* Recent Reports */
.recent-reports {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.recent-reports h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.report-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    background: #f8f9fa;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.report-date {
    font-size: 14px;
    color: #666;
}

.report-score {
    font-size: 18px;
    font-weight: bold;
    color: #007cba;
}

.report-notes {
    margin-bottom: 10px;
    font-style: italic;
    color: #495057;
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #007cba;
}

.report-status {
    display: flex;
    gap: 15px;
}

.slack-status {
    font-size: 12px;
    font-weight: 600;
}

.slack-status.sent {
    color: #28a745;
}

.slack-status.failed {
    color: #dc3545;
}

/* Character Counter */
.char-counter {
    font-size: 12px;
    color: #666;
    text-align: right;
    margin-top: 5px;
}

.char-counter.over-limit {
    color: #dc3545;
    font-weight: bold;
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* No Content States */
.no-games, .no-reports {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 6px;
    border: 2px dashed #ddd;
}

/* Admin Styles */
.coach-admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #007cba;
}

.stat-box h3 {
    font-size: 36px;
    margin: 0;
    color: #007cba;
}

.stat-box p {
    margin: 10px 0 0 0;
    color: #666;
    font-weight: 600;
}

.coach-add-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.coach-add-form h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.coach-admin-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
    margin-top: 30px;
}

.coach-admin-info h2 {
    margin-top: 0;
    color: #333;
}

.coach-admin-info ol {
    padding-left: 20px;
}

.coach-admin-info ul {
    margin-left: 20px;
}

.coach-admin-info code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.coach-settings-help {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    margin-top: 30px;
}

.coach-settings-help h2,
.coach-settings-help h3 {
    color: #333;
}

.coach-settings-help code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
    .coach-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .score-inputs {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .coach-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .coach-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .coach-admin-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .coach-dashboard-container,
    .coach-login-container {
        margin: 10px;
        padding: 15px;
    }
    
    .coach-form {
        padding: 20px;
    }
    
    .games-section,
    .report-section,
    .recent-reports {
        padding: 15px;
    }
    
    .game-card,
    .report-card {
        padding: 12px;
    }
    
    .coach-btn,
    .coach-btn-secondary {
        width: 100%;
        margin-bottom: 10px;
        margin-left: 0;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .coach-form,
    .game-card,
    .report-card {
        border-width: 3px;
    }
    
    .coach-btn,
    .coach-btn-secondary {
        border: 3px solid transparent;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .coach-btn:hover:not(:disabled) {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .coach-header,
    .coach-btn,
    .coach-btn-secondary,
    .game-actions,
    .report-section {
        display: none !important;
    }
    
    .coach-dashboard-container {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    .game-card,
    .report-card {
        border: 1px solid #000 !important;
        box-shadow: none;
        break-inside: avoid;
    }
}