/**
 * ============================================================================
 * UNIFIED DESIGN SYSTEM - Team Exciting
 * Einheitliches Design für alle Seiten basierend auf Teams-Page Style
 * ============================================================================
 * Version: 3.0.0
 * Autor: Team Exciting Design System
 * Datum: 2025-11-12
 */

/* ===========================
   CSS CUSTOM PROPERTIES
   =========================== */
:root {
    /* Primary Colors - Orange/Red Gradient System (from user color scheme) */
    --te-primary-start: #FF6600;
    --te-primary-mid: #FF3300;
    --te-primary-end: #FF0000;
    --te-primary-gradient: linear-gradient(135deg, var(--te-primary-start) 0%, var(--te-primary-mid) 50%, var(--te-primary-end) 100%);

    /* Secondary Colors */
    --te-secondary-start: #FF0000;
    --te-secondary-end: #CC0000;
    --te-secondary-gradient: linear-gradient(135deg, var(--te-secondary-start) 0%, var(--te-secondary-end) 100%);

    /* Accent Colors */
    --te-accent-gold: #FFD700;
    --te-accent-cyan: #00f2fe;
    --te-accent-pink: #f5576c;
    --te-success: #10b981;
    --te-warning: #f59e0b;
    --te-danger: #ef4444;
    --te-info: #3b82f6;

    /* Glassmorphism */
    --te-glass-bg: rgba(255, 255, 255, 0.08);
    --te-glass-bg-light: rgba(255, 255, 255, 0.12);
    --te-glass-bg-dark: rgba(0, 0, 0, 0.15);
    --te-glass-border: rgba(255, 255, 255, 0.18);
    --te-glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);

    /* Background Colors */
    --te-bg-dark: #1a1a2e;
    --te-bg-darker: #16213e;
    --te-bg-light: #ffffff;

    /* Text Colors */
    --te-text-light: #ffffff;
    --te-text-muted: rgba(255, 255, 255, 0.7);
    --te-text-dark: #1a1a2e;
    --te-text-gray: #6b7280;

    /* Border & Shadows */
    --te-border-radius: 20px;
    --te-border-radius-sm: 10px;
    --te-border-radius-lg: 30px;
    --te-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --te-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --te-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);

    /* Spacing */
    --te-spacing-xs: 8px;
    --te-spacing-sm: 16px;
    --te-spacing-md: 24px;
    --te-spacing-lg: 40px;
    --te-spacing-xl: 60px;

    /* Transitions */
    --te-transition-fast: 0.2s ease;
    --te-transition-normal: 0.3s ease;
    --te-transition-slow: 0.5s ease;
}

/* ===========================
   ANIMATED BACKGROUND
   =========================== */
.te-animated-bg,
body.archive,
body.post-type-archive,
body.tax-te_game {
    position: relative;
    min-height: 100vh;
}

.te-animated-bg::before,
body.archive::before,
body.post-type-archive::before,
body.tax-te_game::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--te-primary-gradient);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===========================
   GLASSMORPHISM CARDS
   =========================== */
.te-glass-card,
.archive-item,
.player-card,
.team-card,
.tournament-card,
.match-card,
.gather-card {
    background: var(--te-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--te-glass-border);
    border-radius: var(--te-border-radius);
    padding: var(--te-spacing-md);
    box-shadow: var(--te-glass-shadow);
    transition: all var(--te-transition-normal);
    position: relative;
    overflow: hidden;
}

.te-glass-card:hover,
.archive-item:hover,
.player-card:hover,
.team-card:hover,
.tournament-card:hover,
.match-card:hover,
.gather-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 48px rgba(31, 38, 135, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Glass Card Shine Effect */
.te-glass-card::before,
.archive-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 45%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 55%,
        transparent 100%
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.te-glass-card:hover::before,
.archive-item:hover::before {
    opacity: 1;
    animation: shine 1.5s ease;
}

@keyframes shine {
    0% { left: -50%; }
    100% { left: 150%; }
}

/* ===========================
   BUTTONS - UNIFIED STYLE
   =========================== */
.te-btn,
.btn,
button:not(.close-btn),
input[type="submit"],
input[type="button"],
.wp-block-button__link,
.more-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 30px;
    background: var(--te-primary-gradient);
    color: var(--te-text-light) !important;
    border: none;
    border-radius: var(--te-border-radius-sm);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: all var(--te-transition-normal);
    box-shadow: var(--te-shadow-md);
    position: relative;
    overflow: hidden;
}

.te-btn:hover,
.btn:hover,
button:not(.close-btn):hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.te-btn:active,
.btn:active {
    transform: translateY(-1px);
}

/* Button Variants */
.te-btn-secondary {
    background: var(--te-secondary-gradient) !important;
}

.te-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.te-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.te-btn-outline {
    background: transparent !important;
    border: 2px solid var(--te-glass-border);
    backdrop-filter: blur(10px);
}

.te-btn-outline:hover {
    background: var(--te-glass-bg-light) !important;
    border-color: var(--te-accent-gold);
}

/* ===========================
   TYPOGRAPHY
   =========================== */
h1, h2, h3, h4, h5, h6,
.page-title,
.entry-title,
.post-title {
    color: var(--te-text-light);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--te-spacing-sm);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h5 { font-size: clamp(1.125rem, 2vw, 1.5rem); }
h6 { font-size: clamp(1rem, 1.5vw, 1.25rem); }

p, .description, .excerpt {
    color: var(--te-text-muted);
    line-height: 1.7;
    margin-bottom: var(--te-spacing-sm);
}

a {
    color: var(--te-accent-cyan);
    text-decoration: none;
    transition: all var(--te-transition-fast);
}

a:hover {
    color: var(--te-accent-gold);
    text-decoration: underline;
}

/* ===========================
   CONTENT CONTAINERS & LAYOUT FIX
   =========================== */
#page,
.site {
    position: relative;
    z-index: 1;
}

.site-content,
.content-area,
main {
    position: relative;
    z-index: 10;
    padding: var(--te-spacing-xl) 0;
}

/* Sidebar positioning is now handled by ultimate-sidebar.css */

/* Header should be above content */
#masthead,
.site-header,
header {
    position: relative;
    z-index: 100;
}

/* Navigation should be high but below sidebar */
nav,
.navigation,
.main-navigation,
.tournament-subnav-wrapper {
    position: relative;
    z-index: 999;
}

/* Admin Bar highest */
#wpadminbar {
    z-index: 999999 !important;
}

.container,
.archive-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--te-spacing-md);
}

/* ===========================
   ARCHIVE PAGES GRID
   =========================== */
.archive-grid,
.teams-grid,
.players-grid,
.tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--te-spacing-md);
    margin-top: var(--te-spacing-lg);
}

/* ===========================
   HERO SECTIONS
   =========================== */
.page-hero,
.archive-hero {
    text-align: center;
    margin-bottom: var(--te-spacing-xl);
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-glass {
    background: var(--te-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--te-glass-border);
    border-radius: var(--te-border-radius-lg);
    padding: var(--te-spacing-xl) var(--te-spacing-lg);
    box-shadow: var(--te-glass-shadow);
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, var(--te-accent-gold) 50%, var(--te-accent-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--te-spacing-md);
    animation: textShimmer 3s ease-in-out infinite;
}

@keyframes textShimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

/* ===========================
   BADGES & STATUS
   =========================== */
.badge,
.status-badge,
.game-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--te-glass-bg-light);
    border: 1px solid var(--te-glass-border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--te-text-light);
    backdrop-filter: blur(10px);
}

.badge-primary { background: var(--te-primary-gradient); }
.badge-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.badge-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.badge-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }

/* ===========================
   FORMS & INPUTS
   =========================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 14px 20px;
    background: var(--te-glass-bg);
    border: 1px solid var(--te-glass-border);
    border-radius: var(--te-border-radius-sm);
    color: var(--te-text-light);
    font-size: 16px;
    backdrop-filter: blur(10px);
    transition: all var(--te-transition-normal);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--te-accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.2);
}

input::placeholder,
textarea::placeholder {
    color: var(--te-text-muted);
}

/* ===========================
   LOADING STATES
   =========================== */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--te-glass-border);
    border-top-color: var(--te-accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 768px) {
    :root {
        --te-spacing-xl: 40px;
        --te-spacing-lg: 30px;
    }

    .archive-grid,
    .teams-grid,
    .players-grid,
    .tournaments-grid {
        grid-template-columns: 1fr;
        gap: var(--te-spacing-sm);
    }

    .hero-glass {
        padding: var(--te-spacing-lg) var(--te-spacing-md);
    }

    .te-btn {
        width: 100%;
    }
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fade-in { animation: fadeIn 0.6s ease-out; }
.animate-fade-in-up { animation: fadeInUp 0.8s ease-out; }
.animate-scale-in { animation: scaleIn 0.5s ease-out; }

/* Stagger animation for grid items */
.archive-grid > * {
    animation: fadeInUp 0.6s ease-out backwards;
}

.archive-grid > *:nth-child(1) { animation-delay: 0.1s; }
.archive-grid > *:nth-child(2) { animation-delay: 0.2s; }
.archive-grid > *:nth-child(3) { animation-delay: 0.3s; }
.archive-grid > *:nth-child(4) { animation-delay: 0.4s; }
.archive-grid > *:nth-child(5) { animation-delay: 0.5s; }
.archive-grid > *:nth-child(6) { animation-delay: 0.6s; }
