/*
 * Common styles for all pages (leaderboard, match-history, skins-database)
 * Uses design tokens from styles.css
 */

/* === Global Resets === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    margin: 0;
    background: linear-gradient(135deg, #0f1419 0%, #1a252f 50%, #2d3748 100%);
    min-height: 100vh;
    color: var(--valorant-light);
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === Background Styles === */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f1419 0%, #1a252f 50%, #2d3748 100%);
    z-index: -1;
    overflow: hidden;
}

.background::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 25% 25%, rgba(255, 70, 85, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
    animation: movePattern 20s ease-in-out infinite;
}

.background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(45deg, transparent 49%, rgba(255, 70, 85, 0.02) 50%, transparent 51%),
        linear-gradient(-45deg, transparent 49%, rgba(59, 130, 246, 0.02) 50%, transparent 51%);
    background-size: 60px 60px;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes movePattern {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-30px, -30px) rotate(180deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Header Styles === */
.app-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 0.75rem 0;
    background-color: rgba(15, 25, 35, 0.98);
    border-bottom: 2px solid var(--valorant-red);
    backdrop-filter: blur(15px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    min-height: 60px;
}

.nav-buttons {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    flex-wrap: wrap;
}

.app-header button,
.app-header a.header-button {
    background-color: var(--valorant-red);
    color: var(--valorant-light);
    border: none;
    padding: 0.6rem 1rem;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-height: 40px;
    box-shadow: 0 2px 8px rgba(255, 70, 85, 0.3);
}

.app-header button:hover,
.app-header a.header-button:hover {
    background-color: #e0303f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 70, 85, 0.4);
}

.app-header button.active,
.app-header a.header-button.active {
    background-color: #22c55e;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

.author-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--valorant-light);
    flex-shrink: 0;
}

.author-text {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    display: block;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--valorant-red);
    object-fit: cover;
    flex-shrink: 0;
}

/* === Hamburger Menu === */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    min-width: 40px;
    min-height: 40px;
    background-color: transparent;
    border: 1px solid transparent;
}

.hamburger-menu:hover {
    background-color: rgba(255, 70, 85, 0.1);
    border-color: rgba(255, 70, 85, 0.3);
}

.hamburger-line {
    width: 22px;
    height: 2px;
    background-color: var(--valorant-light);
    margin: 2px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 25, 35, 0.98);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 70, 85, 0.3);
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-bottom: 2px solid rgba(255, 70, 85, 0.5);
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav.active {
    display: block;
}

.mobile-nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
    margin: 0 auto;
}

.mobile-nav .header-button {
    width: 100%;
    text-align: center;
    padding: 1rem 1.5rem;
    margin: 0;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    background-color: rgba(255, 70, 85, 0.1);
    border: 1px solid rgba(255, 70, 85, 0.3);
    transition: all 0.3s ease;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav .header-button:hover {
    background-color: rgba(255, 70, 85, 0.2);
    transform: translateY(-1px);
}

.mobile-nav .header-button.active {
    background-color: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
}

/* === Utility Classes === */
.hidden {
    display: none !important;
}

h2, h3 {
    color: var(--valorant-red);
}

.loading,
.error {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    color: #888;
}

.error {
    color: #f44336;
}

/* === Responsive Breakpoints === */
@media screen and (max-width: 1024px) {
    .nav-buttons {
        gap: 0.25rem;
    }

    .app-header a.header-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media screen and (max-width: 768px) {
    .app-header {
        padding: 0.5rem 0;
    }

    .header-content {
        padding: 0 1rem;
        min-height: 56px;
    }

    .nav-buttons {
        display: none;
    }

    .hamburger-menu {
        display: flex;
    }

    .author-text {
        font-size: 0.8rem;
    }

    .author-avatar {
        width: 32px;
        height: 32px;
    }
}

@media screen and (max-width: 480px) {
    .header-content {
        padding: 0 0.75rem;
        min-height: 52px;
    }

    .author-text {
        font-size: 0.75rem;
    }

    .hamburger-menu {
        min-width: 36px;
        min-height: 36px;
        padding: var(--spacing-xs);
    }

    .hamburger-line {
        width: 20px;
    }

    .mobile-nav {
        padding: 0.75rem;
    }

    .mobile-nav .header-button {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
        min-height: 46px;
    }
}
