/* Component-specific styles */

/* Video Modal Styles */
.video-modal .video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.video-modal .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Video Search Dropdown Styles - Updated Z-Index */
.video-search-dropdown {
    z-index: var(--z-dropdown);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 400px;
    max-height: 300px;
}

.video-search-dropdown .video-result {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.video-search-dropdown .video-result:hover {
    background-color: #f9fafb;
}

.video-search-dropdown .video-result:last-child {
    border-bottom: none;
}

.video-result-thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.video-result-info {
    flex: 1;
    min-width: 0;
}

.video-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-result-channel {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.video-result-actions {
    display: flex;
    gap: 8px;
}

.video-result-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
}

.video-result-btn.use-btn {
    background-color: var(--braves-red);
    color: white;
}

.video-result-btn.use-btn:hover {
    background-color: var(--braves-red-hover);
}

.video-result-btn.preview-btn {
    background-color: #f3f4f6;
    color: #374151;
}

.video-result-btn.preview-btn:hover {
    background-color: #e5e7eb;
}

/* Practice Editor Styles */
.practice-editor-section {
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #fafafa;
}

.practice-editor-section h3 {
    color: #13274f;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.practice-editor-field {
    margin-bottom: 16px;
}

.practice-editor-field label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

.practice-editor-field input,
.practice-editor-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.practice-editor-field input:focus,
.practice-editor-field textarea:focus {
    outline: none;
    border-color: var(--braves-red);
    box-shadow: 0 0 0 3px var(--braves-red-light);
}

.practice-editor-field textarea {
    resize: vertical;
    min-height: 80px;
}

.video-input-group {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.video-input-group input {
    flex: 1;
}

.find-video-btn {
    background-color: var(--braves-navy);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.find-video-btn:hover {
    background-color: var(--braves-red);
}

.find-video-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* Station Editor Styles */
.station-editor {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    background-color: white;
}

.station-editor h4 {
    color: #13274f;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 16px;
}

/* Duration Input Styles */
.duration-input {
    width: 80px;
    text-align: center;
}

.total-time-display {
    background-color: #f0f9ff;
    border: 1px solid #0ea5e9;
    color: #0c4a6e;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
}

/* Admin Dashboard Styles */
.admin-tab {
    transition: all 0.2s ease;
}

.admin-tab.active {
    color: #13274f;
    border-bottom-color: #ce1141;
}

.admin-tab:not(.active):hover {
    color: #13274f;
}

/* Coach Management Styles */
.coach-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coach-info h4 {
    font-weight: 600;
    color: #13274f;
    margin-bottom: 4px;
}

.coach-info p {
    font-size: 14px;
    color: #6b7280;
}

.coach-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.coach-status.active {
    background-color: #dcfce7;
    color: #166534;
}

.coach-status.inactive {
    background-color: #fef2f2;
    color: #dc2626;
}

/* Activity Feed Styles */
.activity-item {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: start;
    gap: 12px;
}

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

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.edit {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.activity-icon.add {
    background-color: #dcfce7;
    color: #166534;
}

.activity-content h4 {
    font-weight: 600;
    color: #13274f;
    margin-bottom: 4px;
}

.activity-content p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 4px;
}

.activity-time {
    font-size: 12px;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 640px) {
    .video-search-dropdown {
        width: 100% !important;
        max-width: 350px;
    }
    
    .video-result {
        padding: 8px;
    }
    
    .video-result-thumbnail {
        width: 60px;
        height: 45px;
    }
    
    .practice-editor-section {
        padding: 16px;
    }
    
    .video-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .find-video-btn {
        margin-top: 8px;
    }
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: var(--braves-red);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Focus States for Accessibility */
.find-video-btn:focus,
.video-result-btn:focus {
    outline: 2px solid var(--braves-red);
    outline-offset: 2px;
}

/* Practice Section Styles */
.practice-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.practice-section:hover {
    border-color: var(--braves-red);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.section-icon {
    color: var(--braves-red);
    font-size: 1.25rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--braves-navy);
    margin: 0;
    flex: 1;
}

.section-duration {
    background-color: var(--braves-red);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.section-content {
    margin-top: 1rem;
}

.section-description {
    color: #475569;
    line-height: 1.6;
    font-size: 1rem;
}

/* Homework Section Styles */
.homework-section {
    margin-top: 3rem;
    padding-top: 2rem;
}

.homework-divider {
    border-top: 3px dotted var(--braves-red);
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.homework-video-btn {
    background-color: var(--braves-red);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.homework-video-btn:hover {
    background-color: var(--braves-red-hover);
    transform: translateY(-1px);
}

/* Error States */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

/* Enhanced Coach Profile Styles */
.enhanced-coach-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.enhanced-coach-card:hover {
    border-color: var(--braves-red);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.coach-profile-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.coach-avatar-container {
    position: relative;
    display: inline-block;
}

.coach-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.coach-avatar-fallback {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--braves-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    border: 2px solid #e5e7eb;
}

.login-status-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
}

.login-status-indicator.recently-active {
    background: #10b981;
    color: white;
}

.login-status-indicator.active-this-week {
    background: #f59e0b;
    color: white;
}

.login-status-indicator.inactive {
    background: #ef4444;
    color: white;
}

.login-status-indicator.long-inactive {
    background: #6b7280;
    color: white;
}

.login-status-indicator.never-logged-in {
    background: #9ca3af;
    color: white;
}

.coach-details {
    flex: 1;
    min-width: 0;
}

.coach-name-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.coach-display-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--braves-navy);
    margin: 0;
}

.edit-name-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0;
}

.coach-name-section:hover .edit-name-btn {
    opacity: 1;
}

.edit-name-btn:hover {
    color: var(--braves-red);
    background-color: #f3f4f6;
}

.coach-email {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.coach-login-info {
    margin-bottom: 8px;
}

.login-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.login-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-status-badge.recently-active {
    background: #d1fae5;
    color: #065f46;
}

.login-status-badge.active-this-week {
    background: #fef3c7;
    color: #92400e;
}

.login-status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.login-status-badge.long-inactive {
    background: #f3f4f6;
    color: #374151;
}

.login-status-badge.never-logged-in {
    background: #f3f4f6;
    color: #6b7280;
}

.login-time {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.login-details {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #9ca3af;
}

.coach-metadata {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.coach-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.activate-btn {
    background-color: #10b981;
    color: white;
}

.activate-btn:hover {
    background-color: #059669;
}

.deactivate-btn {
    background-color: #f59e0b;
    color: white;
}

.deactivate-btn:hover {
    background-color: #d97706;
}

.remove-btn {
    background-color: var(--braves-red);
    color: white;
}

.remove-btn:hover {
    background-color: var(--braves-red-hover);
}

.welcome-btn {
    background-color: var(--braves-red);
    color: white;
}

.welcome-btn:hover {
    background-color: var(--braves-red-hover);
}

/* Name Editing Styles */
.coach-name-input {
    font-size: 18px;
    font-weight: 600;
    color: var(--braves-navy);
    border: 2px solid var(--braves-red);
    border-radius: 4px;
    padding: 4px 8px;
    background: white;
    outline: none;
    min-width: 150px;
}

.name-edit-buttons {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.save-name-btn,
.cancel-name-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.save-name-btn {
    background-color: #10b981;
    color: white;
}

.save-name-btn:hover {
    background-color: #059669;
}

.cancel-name-btn {
    background-color: #6b7280;
    color: white;
}

.cancel-name-btn:hover {
    background-color: #4b5563;
}

/* Station Cards Styling */
.stations-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.station-card {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.station-card:hover {
    border-color: var(--braves-red);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.station-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.station-number {
    background-color: var(--braves-red);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.station-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--braves-navy);
    margin: 0;
    flex: 1;
}

.station-content {
    margin-top: 0.75rem;
}

.station-description {
    color: #475569;
    line-height: 1.5;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.station-video-btn {
    background-color: var(--braves-navy);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
}

.station-video-btn:hover {
    background-color: var(--braves-red);
}

.station-video-btn:focus {
    outline: 2px solid var(--braves-red);
    outline-offset: 2px;
}

/* Mobile Responsive for Stations */
@media (max-width: 640px) {
    .stations-grid {
        gap: 0.75rem;
    }
    
    .station-card {
        padding: 0.75rem;
    }
    
    .station-header {
        gap: 8px;
    }
    
    .station-title {
        font-size: 0.875rem;
    }
    
    .station-video-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.75rem;
        padding: 0.5rem;
    }
}

/* Template Card Styles */
.template-card { 
    transition: all 0.2s ease-in-out; 
}

.template-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.1); 
    border-color: #CE1141; /* Braves Red */
}

/* Create Practice Modal Styles */
.modal-overlay {
    backdrop-filter: blur(4px);
}

.creation-step {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.back-btn:hover {
    color: var(--braves-red) !important;
}

/* Template Grid Styles */
#template-grid .template-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

#template-grid .template-card:hover {
    border-color: var(--braves-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#template-grid .template-card.selected {
    border-color: var(--braves-red);
    background-color: #fef2f2;
    box-shadow: 0 0 0 3px rgba(206, 17, 65, 0.1);
}

.template-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--braves-navy);
    margin-bottom: 0.25rem;
}

.template-card p {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.3;
}

/* AI Creation Form Styles */
#ai-creation-step input,
#ai-creation-step textarea {
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
}

#ai-creation-step input:focus,
#ai-creation-step textarea:focus {
    border-color: var(--braves-red);
    box-shadow: 0 0 0 3px rgba(206, 17, 65, 0.1);
    outline: none;
}

#generate-practice-btn {
    transition: all 0.2s ease;
}

#generate-practice-btn:hover {
    background-color: var(--braves-red-hover);
    transform: translateY(-1px);
}

#generate-practice-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Loading and Success States */
#creation-loading-step .fa-spinner {
    animation: spin 1s linear infinite;
}

#creation-success-step button {
    transition: all 0.2s ease;
}

#creation-success-step button:hover {
    transform: translateY(-1px);
}

/* Creation Option Card Styles */
.creation-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.creation-option-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.creation-option-card:active {
    transform: translateY(-2px);
}

.creation-option-card i {
    margin-bottom: 1rem;
    opacity: 0.9;
}

.creation-option-card h3 {
    margin-bottom: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.3;
}

.creation-option-card p {
    opacity: 0.9;
    line-height: 1.4;
    font-size: 0.875rem;
    margin: 0;
}

/* Add subtle animation */
.creation-option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.creation-option-card:hover::before {
    left: 100%;
}

/* Mobile Responsive for Create Modal */
@media (max-width: 768px) {
    .modal-overlay .bg-white {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    #creation-step-1 .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .creation-option-card {
        padding: 1.5rem 1rem;
        min-height: 160px;
    }
    
    .creation-option-card h3 {
        font-size: 1.125rem;
    }
    
    .creation-option-card p {
        font-size: 0.8rem;
    }
    
    #template-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .template-card {
        padding: 0.75rem;
        min-height: 100px;
    }
    
    .template-card h4 {
        font-size: 0.75rem;
    }
    
    .template-card p {
        font-size: 0.625rem;
    }
    
    #ai-creation-step .space-y-4 {
        max-width: none;
    }
    
    #creation-success-step .flex {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    #creation-success-step button {
        width: 100%;
    }
}

/* Mobile Responsive for Coach Cards */
@media (max-width: 640px) {
    .enhanced-coach-card {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
    }
    
    .coach-profile-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }
    
    .coach-name-section {
        justify-content: center;
    }
    
    .coach-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .action-btn {
        flex: 1;
        min-width: 80px;
    }
}
