/* ==============================
 * File: styles.css (Simplified)
 * Author: Sorta Savage
 * Created: 03/25/2025
 * ============================== */

/* ==============================
 * Fonts
 * ============================== */

@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter/Inter-VariableFont_opsz,wght.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter/Inter-Italic-VariableFont_opsz,wght.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: italic;
}

/* ==============================
 * Variables
 * ============================== */

:root {
    --font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;

    /* Colors */
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --primary-color: #e63946;
    --primary-dark-20: #b82d38;
    --action-red: #c00;
    --button-dark: #222;
    --button-border-dark: #333;
    --button-gray: #808080;
}

/* ==============================
 * Base Styles
 * ============================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==============================
 * Typography
 * ============================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--primary-dark-20);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==============================
 * Card Styles
 * ============================== */

.card_signature {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.card_signature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), #4cc9f0);
}

/* ==============================
 * Header and Navigation
 * ============================== */

header {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--surface-color) 0%, #2d2d2d 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* Subtle glow effect on scroll */
header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header_container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.nav_bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4.5rem;
    padding: 0 1.5rem;
    width: 100%;
    gap: 1rem;
}

/* Logo Section */
.logo_link {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    transition: all var(--transition-speed);
    border-radius: var(--border-radius);
}

.logo_link:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.logo {
    width: 3rem;
    height: 3rem;
    transition: transform var(--transition-speed);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.logo_link:hover .logo {
    transform: scale(1.1) rotate(-5deg);
}

/* Search Box Section */
.search_box {
    flex: 1;
    max-width: 400px;
    margin-left: auto;
}

#search_form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 0.25rem;
    transition: all var(--transition-speed);
}



#search_form:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

#player_search {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

#player_search::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

#search_form input[type="submit"] {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: calc(var(--border-radius) - 2px);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#search_form input[type="submit"]:hover {
    background: var(--primary-dark-20);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#search_form input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Mobile Responsive */
@media (max-width: 600px) {
    header {
        position: relative;
    }

    .nav_bar {
        height: auto;
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .logo_link {
        align-self: flex-start;
    }

    .logo {
        width: 2.5rem;
        height: 2.5rem;
    }

    .search_box {
        width: 100%;
        max-width: none;
        margin-left: 0;
    }

    #search_form {
        padding: 0.2rem;
    }

    #player_search {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    #search_form input[type="submit"] {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* Tablet Responsive */
@media (min-width: 601px) and (max-width: 768px) {
    .nav_bar {
        padding: 0 1rem;
    }

    .search_box {
        max-width: 300px;
    }
}

/* Animation for header appearance */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

header {
    animation: slideDown 0.5s ease-out;
}

/* Optional: Add scroll detection class via JavaScript */
/*
JavaScript to add 'scrolled' class:
window.addEventListener('scroll', () => {
    const header = document.querySelector('header');
    if (window.scrollY > 50) {
        header.classList.add('scrolled');
    } else {
        header.classList.remove('scrolled');
    }
});
*/
/* ==============================
 * Leaderboard Header
 * ============================== */

.leaderboard_header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.last_updated {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* ==============================
 * Player Profile Styles
 * ============================== */

.player_header {
    margin: 2rem 0;
}

.player_info_container {
    background: linear-gradient(135deg, var(--surface-color) 0%, #2d2d2d 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.player_avatar {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    margin-right: 2rem;
    flex-shrink: 0;
}

.player_details {
    flex: 1;
}

.player_name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.rank {
    font-size: small;
}

.player_stats {
    text-align: start;
}

.player_stats_container {
    width: 100%;
    height: 100%;
}

.stat {
    margin-bottom: 0.5rem;
}

.stat_label,
.stat_value {
    color: var(--text-primary);
}

/* Prompt styles */
.player_info_prompt,
.leaderboard_prompt,
.skills_prompt,
.activities_prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    text-align: center;
}

.prompt_content,
.prompt_message {
    color: var(--text-secondary);
}

/* ==============================
 * Modern Table Styles - No Padding Design
 * ============================== */

.table_container {
    background-color: var(--surface-color);
    width: 100%;
    overflow: hidden;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

.data_table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin: 0;
}

/* Enhanced header styling with single color */
th {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 1.25rem 1rem;
    text-align: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Refined cell padding and spacing */
td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    text-align: center;
}

td:last-child {
    border-right: none;
}

tr:last-child td {
    border-bottom: none;
}

/* Enhanced hover effects */
tr {
    transition: all var(--transition-speed) ease;
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
}

th:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

/* ==============================
 * Leaderboard Specific Styles
 * ============================== */

.leaderboard_container {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    padding: 0;
    max-width: 800px;
    margin: 0 auto 2rem auto;
}

/* Enhanced leaderboard column styling */
.rank-cell {
    font-weight: 700;
    text-align: center;
    min-width: 60px;
}

.name-cell {
    font-weight: 600;
    min-width: 120px;
    text-align: center;
}

.level-cell {
    text-align: center;
    font-weight: 500;
    min-width: 100px;
}

.experience-formatted-cell {
    text-align: center;
    font-weight: 500;
    min-width: 80px;
}

/* Enhanced max player highlighting */
.max-player-row {
    background: linear-gradient(90deg,
    rgba(1, 203, 1, 0.08) 0%,
    rgba(1, 203, 1, 0.15) 50%,
    rgba(1, 203, 1, 0.08) 100%);
    border-left: 4px solid #01cb01;
}

/* ==============================
 * Tab Styles
 * ============================== */

.tabs_container {
    box-shadow: var(--box-shadow);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto 2rem auto;
    /* Remove any potential gaps */
    font-size: 0;
}

.tabs_container a {
    color: var(--text-primary);
    text-decoration: underline;
}

.tabs_container a:hover {
    color: var(--primary-dark-20);
    text-decoration: underline;
}

.tabs {
    display: flex;
    background-color: var(--surface-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Ensure no gaps between tabs */
    gap: 0;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab_button {
    flex: 1;
    /* Remove min-width to allow truly equal distribution */
    /* min-width: 100px; */
    padding: 1rem 1.5rem;
    background-color: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    /* Ensure buttons touch each other */
    margin: 0;
    /* Reset font-size from parent */
    font-size: 0.95rem;
}

.tab_button:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.tab_button.active {
    color: var(--primary-color);
}

.tab_button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.tab_content {
    display: none;
}

.tab_content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==============================
 * Player Lookup Table Enhancements
 * ============================== */

.tab_content .table_container {
}

/* Category row colors with refined design */
tr.combat-row {
    border-left: 3px solid var(--primary-color);
    background-color: rgba(230, 57, 70, 0.03);
}

tr.skilling-row {
    border-left: 3px solid var(--button-gray);
    background-color: rgba(128, 128, 128, 0.03);
}

tr.achievement-row {
    border-left: 3px solid #4cc9f0;
    background-color: rgba(76, 201, 240, 0.03);
}

tr.activity-row {
    border-left: 3px solid #28a745;
    background-color: rgba(40, 167, 69, 0.03);
}

/* Legacy category styling for backward compatibility */
tr.combat-row td:first-child {
    border-left: 4px solid var(--primary-color);
}

tr.skilling-row td:first-child {
    border-left: 4px solid var(--button-gray);
}

tr.achievement-row td:first-child {
    border-left: 4px solid var(--button-gray);
}

tr.activity-row td:first-child {
    border-left: 4px solid green;
}

/* ==============================
 * Footer
 * ============================== */

footer {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--surface-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 2rem 0 1.5rem;
    width: 100%;
    position: relative;
    /* Add subtle shadow for depth */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}


.footer_bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.madeby {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    /* Add subtle animation on load */
    animation: fadeInUp 0.6s ease-out;
}

.madeby a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: all var(--transition-speed);
    padding: 0 2px;
}

/* Underline animation on hover */
.madeby a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.madeby a:hover::after {
    width: 100%;
}

.madeby a:hover {
    color: var(--primary-dark-20);
}

/* Heart animation */
.madeby:hover .heart {
    animation: heartbeat 1s ease-in-out;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.copyright_disclaimer {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 1.5rem auto 0;
    padding: 1rem 2rem 0;
    line-height: 1.6;
    max-width: 600px;
    width: 100%;
    /* Add subtle border */
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    footer {
        padding: 1.5rem 0 1rem;
    }

    .footer_bottom {
        padding: 0 1.5rem;
    }

    .madeby {
        font-size: 0.9rem;
        text-align: center;
        width: 100%;
    }

    .copyright_disclaimer {
        font-size: 0.7rem;
        padding: 0.75rem 1.5rem 0;
        margin-top: 1rem;
    }
}

/* Dark mode adjustments (if applicable) */
@media (prefers-color-scheme: dark) {
    footer {
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    }

    footer::before {
        background: linear-gradient(90deg,
        transparent,
        var(--primary-color),
        transparent
        );
        opacity: 0.8;
    }

    .copyright_disclaimer {
        border-top-color: rgba(255, 255, 255, 0.1);
    }
}

/* ==============================
 * Media Queries
 * ============================== */

@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .nav_bar {
        height: auto;
        padding: 1rem;
        gap: 1rem;
        display: grid;
        grid-template-areas:
          "logo nav"
          "search search";
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .nav_bar > a {
        grid-area: logo;
    }

    .nav_links {
        grid-area: nav;
        justify-self: end;
    }

    .search_box {
        grid-area: search;
        margin: 0.75rem 0 0 0;
        max-width: 100%;
    }

    #search_form {
        height: 3rem;
    }

    .search_box input[type="text"],
    .search_box input[type="submit"] {
        height: 100%;
        padding: 0 1rem;
    }

    .search_box input[type="submit"] {
        min-width: 80px;
    }

    .tab_button {
        padding: 0.75rem 0.5rem; /* Reduce horizontal padding on small screens */
        font-size: 0.85rem;
        /* Ensure equal width is maintained */
        flex: 1;
        min-width: 0; /* Allow shrinking below content width */
    }

    .player_info_container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .player_avatar {
        margin-right: 0;
        margin-bottom: 1.5rem;
    }

    .player_name {
        justify-content: center;
        flex-wrap: wrap;
    }

    .footer_bottom {
        flex-direction: column;
        gap: 1.5rem;
    }

    th {
        padding: 1rem 0.75rem;
        font-size: 0.8rem;
    }

    td {
        padding: 0.875rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    th {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }

    td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .data_table {
        min-width: 100%;
    }
    .tabs{        margin: 0 1rem;
    }
    .tab_button {
        padding: 0.75rem 0.25rem; /* Further reduce padding */
        font-size: 0.8rem;
        letter-spacing: 0.02em; /* Reduce letter spacing */
    }
}