/* 
 * Bootstrap 5 Teams Template CSS
 * File: bs5_team.css
 * Created: 2025-07-06
 * Purpose: Styles for team profile pages with Bootstrap 5 migration
 */

/* ==========================================================================
   CSS VARIABLES - Template specific variables only
   ========================================================================== */

:root {
    /* Hero specific variables */
    --hero-overlay-opacity: 0.3;
    --hero-min-height: 400px;
    --hero-min-height-mobile: 250px;
    
    /* Site-wide soft color harmony */
    --fm-soft-blue: #6c9bd2;
    --fm-soft-green: #85c085;
    --fm-soft-red: #d07570;
    --fm-soft-orange: #e6c068;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.team-hero {
    position: relative;
    min-height: var(--hero-min-height);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg, 
        rgba(0, 0, 0, var(--hero-overlay-opacity)), 
        rgba(26, 26, 26, var(--hero-overlay-opacity))
    );
    z-index: 1;
}

.team-hero .container {
    position: relative;
    z-index: 2;
}

.team-hero .hero-title {
    font-family: var(--fm-font-display);
    font-size: clamp(2rem, 5vw, 3.5rem); /* Responsive typography */
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

}

.hero-image-source {
    background: var(--fm-dark-light);
    padding: 0.5rem 1rem;
    text-align: center;
}

.hero-image-source .image-source-text {
    color: var(--fm-gray-light);
    font-family: var(--fm-font-primary);
    font-size: var(--fm-text-base);
    font-style: italic;
}

/* Mobile responsiveness for hero */
@media (max-width: 768px) {
    .team-hero {
        min-height: var(--hero-min-height-mobile);
    }
    
    /* Typography is already responsive via clamp() */
    
    /* Use mobile background image */
    .team-hero[data-mobile-bg] {
        background-image: var(--mobile-bg) !important;
    }
}

/* ==========================================================================
   TAB SYSTEM
   ========================================================================== */

.team-tabs-nav {
    border-bottom: 2px solid var(--fm-gray-light);
    margin-bottom: 0;
}

.team-tabs-nav .nav-link {
    color: var(--fm-gray);
    font-family: var(--fm-font-primary);
    font-size: var(--fm-text-base);
    font-weight: 500;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.team-tabs-nav .nav-link:hover {
    color: var(--fm-gold);
    border-bottom-color: var(--fm-gold-light);
    background-color: transparent;
}

.team-tabs-nav .nav-link.active {
    color: var(--fm-gold);
    background-color: transparent;
    border-bottom-color: var(--fm-gold);
    font-weight: 600;
}

.team-tabs-content {
    padding-top: 1.5rem;
}

/* Mobile tab navigation */
@media (max-width: 768px) {
    .team-tabs-nav {
        flex-wrap: wrap;
    }
    
    .team-tabs-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   CARDS AND COMPONENTS
   ========================================================================== */

/* FM Card System - matching site-wide patterns */
.team-tabs-content .card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--fm-border-radius-lg);
    background-color: var(--fm-white);
    transition: all 0.3s ease;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Note: Card hover effects handled by central .fm-card--hover-subtle system */

.team-tabs-content .card-header {
    background: var(--fm-gold);
    color: var(--fm-white);
    border-bottom: none;
    border-radius: var(--fm-border-radius-lg) var(--fm-border-radius-lg) 0 0;
    font-weight: 600;
}

/* Specific header colors for different content types */
.team-tabs-content .card-header.penalties {
    background: var(--fm-danger);
    color: var(--fm-white);
}

.team-tabs-content .card-header.statistics {
    background: var(--fm-info);
    color: var(--fm-white);
}

.team-tabs-content .card-header.warning {
    background: var(--fm-warning);
    color: var(--fm-dark);
}

.team-tabs-content .card-header.neutral {
    background: var(--fm-gray);
    color: var(--fm-white);
}

.team-tabs-content .card-title {
    font-family: var(--fm-font-display);
    font-size: 1.125rem; /* Matching site typography scale */
    font-weight: 600;
    margin-bottom: 0;
}

.team-tabs-content .card-body {
    padding: 1.5rem;
    font-size: var(--fm-text-base); /* Consistent base font size */
    font-family: var(--fm-font-primary);
}

/* ==========================================================================
   INFO CARDS (for team data, stats, etc.)
   ========================================================================== */

.team-info-card {
    background: linear-gradient(135deg, #f8f9fa, var(--fm-white));
    border-left: 4px solid var(--fm-gold);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.team-info-card h4 {
    color: var(--fm-dark-gray);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.team-stats-card {
    background: var(--fm-white);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--fm-border-radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100px;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Note: Stats card hover effects handled by central .fm-card--hover-subtle system */

.team-stats-card .stats-number {
    font-family: var(--fm-font-display);
    font-size: 2rem; /* Slightly smaller for better proportion */
    font-weight: 700;
    color: var(--fm-gold);
    display: block;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.team-stats-card .stats-number-compact {
    font-size: 1.5rem;
}

.team-stats-card .stats-label {
    color: var(--fm-gray);
    font-size: var(--fm-text-base);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--fm-font-primary);
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.team-table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.team-table th,
.team-table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--fm-light-gray);
}

.team-table th {
    background: var(--fm-light-gray);
    color: var(--fm-dark-gray);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.team-table tbody tr:hover {
    background-color: rgba(182, 139, 71, 0.1); /* Using FM-Gold RGB values */
}

/* Responsive tables */
.team-table--responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .team-table--responsive {
        font-size: 0.875rem;
    }
    
    .team-table--responsive th,
    .team-table--responsive td {
        padding: 0.5rem;
    }
}

/* ==========================================================================
   CHARTS
   ========================================================================== */

/* Ensure card body uses full height for charts */
.card.h-100 .card-body:has(.team-chart-container) {
    display: flex;
    flex-direction: column;
    height: calc(100% - 56px); /* Subtract card header height */
}

/* Fix for tab pane content */
.tab-pane .card.h-100 {
    height: 100% !important;
}

/* Ensure charts in inactive tabs render correctly when shown */
.tab-pane:not(.active) .team-chart-container {
    position: absolute;
    visibility: hidden;
}

.tab-pane.active .team-chart-container {
    position: relative;
    visibility: visible;
}

.team-chart-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    padding: 1rem;
    background: var(--fm-white);
    border-radius: 8px;
    border: 1px solid var(--fm-border-light);
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-chart-container canvas {
    max-height: 400px;
    width: 100% !important;
    height: 100% !important;
}

.team-chart--mobile {
    display: none;
}

.team-chart--desktop {
    display: block;
}

@media (max-width: 768px) {
    .team-chart--mobile {
        display: block;
        min-height: 250px;
    }
    
    .team-chart--desktop {
        display: none;
    }
    
    .team-chart-container {
        min-height: 250px;
    }
    
    .team-chart-container canvas {
        max-height: 250px;
    }
}

/* Chart loading state */
.team-chart-container.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--fm-dark-gray);
}

.team-chart-container.loading::before {
    content: "Lade Chart-Daten...";
    font-style: italic;
}

/* ==========================================================================
   GALLERY
   ========================================================================== */

/* FM Gallery System - matching image card patterns */
.team-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.team-gallery__item {
    position: relative;
    border-radius: var(--fm-border-radius-lg);
    overflow: hidden;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.team-gallery__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--fm-gold);
}

.team-gallery__item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.team-gallery__item:hover img {
    transform: scale(1.02);
}

.team-gallery__item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.team-gallery__item:hover .overlay {
    opacity: 1;
}

.team-gallery__item .overlay-text {
    color: var(--fm-white);
    font-family: var(--fm-font-primary);
    font-size: var(--fm-text-base);
    font-weight: 500;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
    .team-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .team-gallery__item img {
        height: 120px;
    }
}

/* ==========================================================================
   NEWS CARDS
   ========================================================================== */

.team-news-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--fm-border-radius-lg);
    background-color: var(--fm-white);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.team-news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--fm-gold);
}

.team-news-card .card-title {
    font-family: var(--fm-font-display);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--fm-dark);
}

.team-news-card .card-text {
    font-family: var(--fm-font-primary);
    font-size: var(--fm-text-base);
    line-height: 1.4;
    color: var(--fm-gray);
}

/* FM Button System */
.team-news-card .btn,
.team-tabs-content .btn {
    background-color: var(--fm-white);
    color: var(--fm-dark);
    border: 1px solid var(--fm-dark);
    border-radius: var(--fm-border-radius-md);
    font-family: var(--fm-font-primary);
    font-size: var(--fm-text-base);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
}

.team-news-card .btn:hover,
.team-tabs-content .btn:hover {
    background-color: var(--fm-dark);
    color: var(--fm-gold);
    border-color: var(--fm-dark);
    transform: translateY(-1px);
}

.team-news-card .btn-primary,
.team-tabs-content .btn-primary {
    background-color: var(--fm-gold);
    color: var(--fm-white);
    border-color: var(--fm-gold);
}

.team-news-card .btn-primary:hover,
.team-tabs-content .btn-primary:hover {
    background-color: var(--fm-gold-dark);
    color: var(--fm-white);
    border-color: var(--fm-gold-dark);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.text-fm-gold {
    color: var(--fm-gold) !important;
}

.bg-fm-gold {
    background-color: var(--fm-gold) !important;
}

.border-fm-gold {
    border-color: var(--fm-gold) !important;
}

.text-white-75 {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--fm-light-gray);
    border-radius: 50%;
    border-top-color: var(--fm-gold);
    animation: spin 1s ease-in-out infinite;
}

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

/* ==========================================================================
   RESPONSIVE UTILITIES
   ========================================================================== */

@media (max-width: 576px) {
    .team-tabs-content .card-body {
        padding: 1rem;
    }
    
    .team-info-card {
        padding: 1rem;
    }
    
    .team-stats-card .stats-number {
        font-size: 2rem;
    }
}

/* Print styles */
@media print {
    .team-hero,
    .team-tabs-nav,
    .hero-image-source {
        display: none !important;
    }
    
    .team-tabs-content .tab-pane {
        display: block !important;
    }
    
    .team-tabs-content .card {
        border: 1px solid var(--fm-border-light);
        box-shadow: none;
        page-break-inside: avoid;
    }
}