/* =================================================================
   TransferPortl Shared Styles
   Common CSS used across all templates
   ================================================================= */

/* CSS Variables */
:root {
    --brand-green: #00C100;
    --header-bg: #000000;
    --body-bg: #f2f2f2;
    --card-bg: #fff;
    --card-border: #ddd;
    --text-primary: #000;
    --text-secondary: #666;
    --link-color: #1d5d90;
    --max-width: 1200px;
    --font-display: 'Zing Rust Base', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
    --font-data: 'IBM Plex Mono', monospace;
}

/* =================================================================
   FONT FACE
   ================================================================= */
@font-face {
    font-family: 'Zing Rust Base';
    src: url('/static/fonts/ZingRustBase.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* =================================================================
   CSS RESET
   ================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-mono);
    background: var(--body-bg);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* =================================================================
   FONT ASSIGNMENTS
   ================================================================= */

/* Team and player names */
.team-name,
.player-name,
.team-cell a,
.player-cell a {
    font-family: var(--font-mono) !important;
}

/* All numbers */
.stat-number,
.stat-value,
.market-value,
.ranking-number {
    font-family: var(--font-data) !important;
}

/* Table headers */
th {
    font-family: var(--font-data) !important;
}

/* Card headers */
.card-header,
.section-title {
    font-family: var(--font-mono) !important;
}

/* =================================================================
   HEADER
   ================================================================= */
.header {
    background: var(--header-bg);
    padding: 0;
}

.header-top {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    background: var(--brand-green);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
}

.nav-links {
    display: none;
}

/* =================================================================
   NAVIGATION
   ================================================================= */
.main-nav {
    background: #000;
    border-top: 1px solid #222;
}

.main-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.main-nav-inner::-webkit-scrollbar {
    display: none;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-display) !important;
    padding: 10px 16px;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}

.main-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.main-nav a.active {
    color: var(--brand-green);
}

/* =================================================================
   SEARCH BAR
   ================================================================= */
.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 30px;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    outline: none;
    transition: background 0.2s;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.25);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    margin-top: 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.search-result-icon {
    font-size: 18px;
    width: 32px;
    height: 32px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-result-icon img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-weight: 500;
    color: var(--text-primary);
}

.search-result-meta {
    font-size: 11px;
    color: #888;
}

.search-result-type {
    font-size: 10px;
    text-transform: uppercase;
    color: #888;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
}

.search-no-results {
    padding: 15px;
    text-align: center;
    color: #888;
    font-style: italic;
}

/* =================================================================
   STATS BAR
   ================================================================= */
.stats-bar {
    background: linear-gradient(180deg, #000000 0%, #0d0d0d 100%);
    border-bottom: 1px solid #333;
    display: flex;
    align-items: stretch;
}

.stats-content {
    display: flex;
    flex-shrink: 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    border-right: 1px solid #333;
    transition: background 0.15s;
    text-decoration: none;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.stat-item:last-child {
    border-right: none;
}

.stat-number {
    font-family: var(--font-data);
    font-size: 28px;
    font-weight: 600;
    color: var(--brand-green);
    letter-spacing: -1px;
    line-height: 1;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* =================================================================
   MAIN CONTAINER
   ================================================================= */
.main-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 15px;
}

/* =================================================================
   CARDS
   ================================================================= */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    margin-bottom: 16px;
}

.card-header {
    background: var(--brand-green);
    color: #fff;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header a {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 400;
}

.card-body {
    padding: 0;
}

/* =================================================================
   TABLES
   ================================================================= */
.transfer-table {
    width: 100%;
    border-collapse: collapse;
}

.transfer-table th {
    background: #f5f5f5;
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    border-bottom: 2px solid var(--card-border);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.transfer-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.transfer-table th.sortable:hover {
    background: #e8e8e8;
}

.transfer-table th.sortable a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.transfer-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    line-height: 1.4;
    white-space: nowrap;
}

.transfer-table tr:hover {
    background: #f9fdf9;
}

/* =================================================================
   PLAYER & TEAM CELLS
   ================================================================= */
.player-cell {
    white-space: nowrap;
}

.player-cell-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.player-photo {
    width: 32px;
    height: 32px;
    background: #eee;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.player-name {
    font-weight: 500;
    color: var(--link-color);
}

.player-pos {
    font-size: 14px;
    color: var(--text-secondary);
}

.team-cell {
    white-space: nowrap;
}

.team-cell a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.team-cell img {
    width: 20px;
    height: 20px;
}

.stars {
    color: #ffc107;
    font-size: 14px;
    letter-spacing: -1px;
}

.date-cell {
    color: #888;
    font-size: 14px;
    font-family: var(--font-data) !important;
}

.transfer-arrow {
    color: var(--brand-green);
    font-weight: 700;
}

.uncommitted {
    color: #999;
    font-style: italic;
}

.pos-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background: #f0f0f0;
    color: var(--text-secondary);
}

/* =================================================================
   PROBABILITY BADGES
   ================================================================= */
.probability-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-data);
    background: #f5f5f5;
    color: #000;
}

.probability-badge.high {
    background: #e0e0e0;
    color: #000;
}

.probability-badge.medium {
    background: #eee;
    color: #000;
}

.probability-badge.low {
    background: #f5f5f5;
    color: #000;
}

/* =================================================================
   SIDEBAR TRANSFERS
   ================================================================= */
.sidebar-transfer {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.sidebar-transfer:hover {
    background: #f9fdf9;
}

.sidebar-transfer:last-child {
    border-bottom: none;
}

.player-headshot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #e8e8e8;
    flex-shrink: 0;
}

.player-headshot-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    display: inline-block;
    flex-shrink: 0;
}

.transfer-info {
    flex: 1;
    min-width: 0;
}

.transfer-info .name {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--link-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transfer-info .meta {
    font-family: var(--font-mono);
    font-size: 14px;
    color: #888;
}

.transfer-info .meta a {
    font-family: var(--font-mono);
}

.transfer-teams {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.transfer-teams img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.transfer-teams .arrow {
    color: var(--brand-green);
    font-size: 16px;
}

/* =================================================================
   TABS
   ================================================================= */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 15px;
    border-bottom: 3px solid var(--brand-green);
}

.tab {
    padding: 12px 24px;
    background: #e0e0e0;
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #ccc;
    border-bottom: none;
    margin-right: -1px;
    font-family: var(--font-mono) !important;
}

.tab:hover {
    background: #d0d0d0;
    text-decoration: none;
}

.tab.active {
    background: var(--brand-green);
    color: #fff;
    border-color: var(--brand-green);
}

.tab .count {
    background: rgba(0, 0, 0, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 8px;
}

.tab.active .count {
    background: rgba(255, 255, 255, 0.25);
}

/* =================================================================
   FILTERS
   ================================================================= */
.filters {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 12px 15px;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.search-box::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-size: contain;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    background: var(--card-bg);
}

/* =================================================================
   FOOTER
   ================================================================= */
.footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 15px;
    text-align: center;
    font-size: 14px;
    color: #888;
    border-top: 1px solid var(--card-border);
}

/* =================================================================
   AD PLACEHOLDERS
   ================================================================= */
.ad-slot {
    display: none;
    background: #f5f5f5;
    border: 1px dashed #ccc;
    justify-content: center;
    align-items: center;
    color: #999;
    font-size: 14px;
    text-transform: uppercase;
}

.ad-leaderboard {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 90px;
    padding: 0 15px;
}

.ad-leaderboard-inner {
    width: 728px;
    height: 90px;
    margin: 0 auto;
}

.ad-rectangle {
    width: 300px;
    height: 250px;
    margin-bottom: 16px;
}

.ad-sidebar-tall {
    width: 300px;
    height: 600px;
}

.ad-in-feed {
    width: 100%;
    height: 100px;
    margin: 16px 0;
}

/* =================================================================
   EMPTY / STATUS MESSAGES
   ================================================================= */
.empty-message {
    font-family: var(--font-mono) !important;
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* =================================================================
   BREADCRUMB
   ================================================================= */
.breadcrumb {
    font-family: var(--font-mono) !important;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 10px 0;
}

.breadcrumb a {
    font-family: var(--font-mono) !important;
    color: var(--link-color);
}
