/* assets/css/style.css */

/* Design Tokens & Variables */
:root {
    --bg-primary: #0a0b0e;
    --bg-secondary: #12151c;
    --bg-tertiary: #1b1f29;
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(197, 168, 128, 0.3);
    
    /* Text Colors */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Accents */
    --gold: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.2);
    --gold-hover: #f3cf55;
    
    --crimson: #e63946;
    --crimson-glow: rgba(230, 57, 70, 0.2);
    --crimson-hover: #ff5260;
    
    --emerald: #2a9d8f;
    --emerald-glow: rgba(42, 157, 143, 0.2);
    --emerald-hover: #3bb3a4;

    --silver: #b0c4de;
    --silver-glow: rgba(176, 196, 222, 0.2);
    
    --font-heading: 'Outfit', 'Montserrat', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 0 15px rgba(212, 175, 55, 0.25);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.app-header {
    background: rgba(18, 21, 28, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 70px;
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.logo-text {
    background: linear-gradient(135deg, #fff 60%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover, .nav-link.active {
    color: var(--gold);
}

/* Main Layout */
.main-content {
    flex: 1;
    padding: 40px 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, #b29329 100%);
    color: #000;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-hover) 0%, var(--gold) 100%);
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    color: var(--gold);
    border-color: var(--gold);
}

.btn-danger {
    background: var(--crimson);
    color: #fff;
}

.btn-danger:hover {
    background: var(--crimson-hover);
    box-shadow: var(--crimson-glow);
}

.btn-success {
    background: var(--emerald);
    color: #fff;
}

.btn-success:hover {
    background: var(--emerald-hover);
    box-shadow: var(--emerald-glow);
}

/* Typography & Helpers */
.gold-text { color: var(--gold); }
.crimson-text { color: var(--crimson); }
.emerald-text { color: var(--emerald); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 0.5em;
    color: var(--text-primary);
}

/* Card / Panels (Glassmorphism) */
.panel {
    background: rgba(18, 21, 28, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.panel-title {
    margin-bottom: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .grid-3, .grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    .header-container {
        flex-direction: column;
        gap: 15px;
        padding: 10px 0;
    }
    .app-header {
        height: auto;
    }
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
}

/* Hero Poster Style (Rules Sidebar/Section) */
.poster-card {
    background: linear-gradient(180deg, #1b160f 0%, #12151c 100%);
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: var(--shadow-gold);
    position: relative;
    overflow: hidden;
}

.poster-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--crimson), var(--gold));
}

.poster-header {
    text-align: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.poster-title {
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.poster-subtitle {
    color: var(--gold);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 5px;
}

.rules-list {
    list-style: none;
    margin-bottom: 20px;
}

.rules-list li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.rules-list li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 2px;
    color: var(--gold);
    font-size: 0.8rem;
}

.points-table-mini {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.points-table-mini th, .points-table-mini td {
    padding: 6px 12px;
    text-align: left;
}

.points-table-mini th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-weight: 600;
}

.points-table-mini tr:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* Leaderboard Table */
.search-bar-container {
    margin-bottom: 20px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.poker-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
    margin-top: -6px;
}

.poker-table th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 20px;
    text-align: left;
    border: none;
}

.poker-table tbody tr {
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
    cursor: pointer;
}

.poker-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.poker-table td {
    padding: 15px 20px;
    vertical-align: middle;
}

/* Rounding corners on rows */
.poker-table td:first-child {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.poker-table td:last-child {
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

.rank-col {
    width: 70px;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center !important;
}

.player-col {
    font-weight: 600;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-gold {
    background: linear-gradient(135deg, #ffd700 0%, #c5a880 100%);
    color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.badge-silver {
    background: linear-gradient(135deg, #d3d3d3 0%, #a9a9a9 100%);
    color: #000;
    box-shadow: 0 0 10px rgba(211, 211, 211, 0.3);
}

.badge-bronze {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-inactive {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-dialog {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 600px;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-dialog {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    margin-bottom: 0;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--crimson);
}

.modal-body {
    padding: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}

/* Stats Cards (Admin Dashboard) */
.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.03);
}

.stat-icon {
    font-size: 2.2rem;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.gold { background: rgba(212, 175, 55, 0.1); color: var(--gold); }
.stat-icon.crimson { background: rgba(230, 57, 70, 0.1); color: var(--crimson); }
.stat-icon.emerald { background: rgba(42, 157, 143, 0.1); color: var(--emerald); }

.stat-details h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-details p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Point record form styles */
.placement-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.placement-badge {
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.placement-badge.gold { background: rgba(212, 175, 55, 0.15); color: var(--gold); }

/* Footer styling */
.app-footer {
    background: #060709;
    border-top: 1px solid var(--border-color);
    padding: 50px 0 20px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.footer-brand h4 {
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
    max-width: 400px;
}

.contact-info p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.contact-info a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.contact-info a:hover {
    color: var(--gold);
}

.footer-partners h5 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.partner-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.partner-chip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Alert Boxes */
.alert {
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(42, 157, 143, 0.12);
    border: 1px solid var(--emerald);
    color: #e2f4f2;
}

.alert-danger {
    background: rgba(230, 57, 70, 0.12);
    border: 1px solid var(--crimson);
    color: #fde8ea;
}

/* -------------------------------------------------------------
   Dynamic Tabs & Hero Section Styles
   ------------------------------------------------------------- */

/* Tabs Header */
.tabs-header {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    top: 2px;
    outline: none;
}

.tab-btn:hover {
    color: var(--gold);
}

.tab-btn.active {
    color: var(--gold);
    border-bottom: 2px solid var(--gold);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero-banner {
    position: relative;
    height: 320px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 11, 14, 0.95) 30%, rgba(10, 11, 14, 0.5) 75%, rgba(212, 175, 55, 0.1) 100%);
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 40px;
}

.hero-text {
    position: relative;
    z-index: 3;
    max-width: 600px;
}

.hero-text h1 {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 60%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .hero-banner {
        height: auto;
        min-height: 250px;
        padding: 20px;
    }
    .hero-overlay {
        padding: 25px;
    }
    .hero-text h1 {
        font-size: 1.9rem;
    }
    .hero-text p {
        font-size: 0.9rem;
    }

    /* Global mobile-friendly styling improvements */
    .app-header {
        height: auto !important;
        padding: 15px 0;
    }
    .header-container {
        flex-direction: column !important;
        gap: 12px !important;
        text-align: center;
    }
    .logo {
        justify-content: center;
    }
    .nav-menu {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 15px !important;
        width: 100%;
    }
    .poker-table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    .panel {
        padding: 15px !important;
    }
    .event-banner {
        height: auto !important;
        min-height: 250px !important;
        padding: 20px !important;
    }
    .modal-dialog {
        width: 95% !important;
        margin: 20px auto !important;
        padding: 15px !important;
    }
    .form-actions {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .form-actions button, .form-actions a, .form-actions input {
        width: 100% !important;
        justify-content: center !important;
    }
}
