/* CardPulse — Dark Modern Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --navy: #18181b;
    --navy-light: #27272a;
    --gold: #22c55e;
    --gold-light: #4ade80;
    --cream: #0a0a0a;
    --cream-dark: #27272a;
    --terracotta: #f59e0b;
    --sage: #3b82f6;
    --text-dark: #fafafa;

    /* Shadow scale */
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.2);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);

    /* Border radius scale */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

/* ============ Utility Classes ============ */

.base-card {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
}

.card-heading {
    color: #fafafa;
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #27272a;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #d4d4d8;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Header */
header {
    background: rgba(10,10,10,0.85);
    backdrop-filter: blur(20px);
    color: white;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.logo {
    height: 50px;
    width: 50px;
    border-radius: 50%;
}

.nav-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
}

.header-logo {
    height: 28px;
    width: auto;
}

header h1 {
    font-size: 1.2rem;
    color: white;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.export-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.export-controls input[type="date"] {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--navy-light);
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--navy-light);
    color: white;
}

.export-controls input[type="date"]:focus {
    outline: none;
    border-color: var(--gold);
}

/* Dropdown Menus */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: '';
    display: inline-block;
    margin-left: 0.4rem;
    border-top: 4px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    vertical-align: middle;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    min-width: 180px;
    z-index: 200;
    overflow: hidden;
}

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-item {
    padding: 0.6rem 1rem;
    color: #d4d4d8;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: #27272a;
    color: white;
}

.dropdown-divider {
    height: 1px;
    background: var(--cream-dark);
    margin: 0.25rem 0;
}

.dropdown-item.export-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem;
}

.dropdown-item.export-row input[type="date"] {
    flex: 1;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--cream-dark);
    border-radius: 4px;
    font-size: 0.8rem;
}

.dropdown-item.export-row:hover {
    background: transparent;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn-primary {
    background: #22c55e;
    color: white;
}

.btn-primary:hover {
    background: #16a34a;
}

.btn-secondary {
    background: #27272a;
    border: 1px solid #3f3f46;
    color: #d4d4d8;
}

.btn-secondary:hover {
    background: #3f3f46;
    color: white;
}

.btn-success {
    background: #22c55e;
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Main Content */
main {
    padding: 2rem;
    max-width: 100%;
    margin: 0 auto;
}

/* View Controls */
.view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.filter-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid #3f3f46;
    border-radius: 8px;
    font-size: 0.85rem;
    background: #18181b;
    color: #d4d4d8;
    cursor: pointer;
    font-family: inherit;
}

.filter-select:focus {
    outline: none;
    border-color: #22c55e;
}

.filter-controls input {
    padding: 0.5rem 1rem;
    border: 1px solid #3f3f46;
    border-radius: 8px;
    font-size: 0.85rem;
    background: #18181b;
    color: #d4d4d8;
    width: 200px;
    font-family: inherit;
}

.filter-controls input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.1);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card {
    background: #18181b;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: 1px solid #27272a;
    text-decoration: none;
    display: block;
    color: inherit;
}

.card:hover {
    transform: translateY(-2px);
    border-color: #3f3f46;
    box-shadow: var(--shadow-lg);
}

.card-image {
    aspect-ratio: 3/4;
    background: #111113;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    color: #52525b;
    font-size: 0.9rem;
}

.card-info {
    padding: 1rem;
}

.card-player {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.card-set {
    color: #71717a;
    font-size: 0.85rem;
}

.card-team {
    color: #a1a1aa;
    font-size: 0.85rem;
    margin: 0.25rem 0;
    font-weight: 500;
}

.card-brand {
    color: #71717a;
    font-size: 0.8rem;
    margin: 0.25rem 0;
}

.card-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0.5rem 0;
}

.brand-logo {
    height: 16px;
    width: auto;
    vertical-align: middle;
}

.brand-logo.ebay-logo {
    height: 14px;
}

.brand-logo.panini-logo {
    height: 14px;
}

.brand-logo.topps-logo {
    height: 14px;
}

.table-badges {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.table-badges .brand-logo {
    height: 12px;
}

.card-cost {
    font-size: 0.8rem;
    color: #52525b;
    margin: 0;
}

.card-profit {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0;
}

.profit-positive {
    color: var(--sage);
}

.profit-negative {
    color: var(--terracotta);
}

.card-price {
    font-weight: bold;
    color: var(--gold);
    font-size: 1rem;
    margin: 0;
}

.card-prices {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.card-market-price {
    font-size: 0.85rem;
    color: #71717a;
    margin: 0;
}

.market-price {
    font-weight: 500;
}

.market-price.no-data {
    color: #52525b;
}

.market-price.price-good {
    color: var(--sage);
    font-weight: 600;
}

.market-price.price-high {
    color: var(--terracotta);
    font-weight: 600;
}

.card-status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.status-available {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.status-sold {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.card-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
}

.card-days-listed {
    font-size: 0.7rem;
    color: #52525b;
}

.days-column {
    font-size: 0.85rem;
    color: #71717a;
}

.card.sold {
    opacity: 0.7;
}

.card.sold .card-image::after {
    content: 'SOLD';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: rgba(220, 38, 38, 0.9);
    color: white;
    padding: 0.5rem 2rem;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 4px;
}

.card .card-image {
    position: relative;
}

.card-actions {
    padding: 0 1rem 1rem;
    display: flex;
    gap: 0.5rem;
}

/* Cards Table */
.cards-table-container {
    background: #18181b;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.cards-table {
    width: 100%;
    border-collapse: collapse;
}

.cards-table th,
.cards-table td {
    padding: 0.75rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #27272a;
}

.table-thumbnail {
    width: 40px;
    padding: 0.25rem 0.5rem;
}

.table-thumbnail .thumbnail {
    width: 36px;
    height: 48px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.table-thumbnail .no-thumb {
    color: #ccc;
}

.cards-table th {
    background: var(--navy);
    color: var(--gold);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.cards-table tr:hover {
    background: #111113;
}

.cards-table tr.row-sold {
    background: rgba(239, 68, 68, 0.08);
    opacity: 0.7;
}

.cards-table tr.row-sold:hover {
    background: rgba(239, 68, 68, 0.12);
    opacity: 1;
}

.cards-table td:last-child {
    white-space: nowrap;
}

.ebay-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.ebay-link:hover {
    text-decoration: underline;
    color: var(--gold);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #71717a;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
    background: #18181b;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

#page-info {
    color: #71717a;
    font-size: 0.9rem;
    min-width: 100px;
    text-align: center;
}

.pagination-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #111113;
    color: white;
    border-bottom: 1px solid #27272a;
}

.modal-header h2 {
    font-size: 1.25rem;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #71717a;
}

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

/* Forms */
form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #a1a1aa;
    font-size: 0.85rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #3f3f46;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #0a0a0a;
    color: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.1);
}

.form-group input[type="file"] {
    font-size: 0.9rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e5e5;
}

.image-preview {
    margin-top: 0.5rem;
    max-height: 150px;
    overflow: hidden;
    border-radius: 4px;
}

.image-preview img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

/* Teams Modal */
.team-form {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #27272a;
}

.team-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.teams-table {
    width: 100%;
    border-collapse: collapse;
}

.teams-table th,
.teams-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #27272a;
}

.teams-table th {
    background: var(--cream-dark);
    font-weight: 600;
    color: white;
}

.teams-table td:last-child {
    text-align: right;
}

/* Price Check Modal */
.modal-wide {
    max-width: 800px;
    width: 95%;
}

.price-check-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.price-check-info {
    margin-bottom: 1rem;
    color: #71717a;
}

.price-check-table {
    width: 100%;
    border-collapse: collapse;
}

.price-check-table th,
.price-check-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--cream-dark);
}

.price-check-table th {
    background: var(--cream-dark);
    color: white;
    font-weight: 600;
}

.price-check-table td {
    vertical-align: middle;
}

.price-check-table td:last-child {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.market-price-input {
    width: 80px;
    padding: 0.35rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.market-price-input:focus {
    outline: none;
    border-color: var(--navy);
}

.market-price-input:disabled {
    background: var(--cream-dark);
}

/* Header Navigation */
.header-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    color: #a1a1aa;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.06);
}

.nav-link.active {
    background: rgba(34,197,94,0.12);
    color: #22c55e;
    font-weight: 600;
}

/* Dashboard */
.dashboard {
    max-width: 100%;
    margin: 0 auto;
}

.dashboard-title {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: none;
}

.metric-card h3 {
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #27272a;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #111113;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-row.highlight {
    background: #111113;
    margin: 0.5rem -1.25rem;
    padding: 0.75rem 1.25rem;
    border-bottom: none;
    border-radius: 6px;
}

.metric-label {
    color: #71717a;
    font-size: 0.9rem;
}

.metric-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
}

.text-success {
    color: #22c55e;
}

.text-warning {
    color: #f59e0b;
}

.text-muted {
    color: #52525b;
}

.text-profit {
    color: #22c55e;
}

.text-loss {
    color: #ef4444;
}

/* Dashboard Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.chart-card h3 {
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.chart-card canvas {
    max-height: 250px;
}

/* Dashboard Lists */
.lists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.list-card {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.list-card h3 {
    color: white;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.list-subtitle {
    color: #52525b;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
    padding: 0.6rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #27272a;
}

.dashboard-table th {
    font-size: 0.8rem;
    color: #52525b;
    font-weight: 500;
    text-transform: uppercase;
}

.dashboard-table td {
    font-size: 0.9rem;
    color: #d4d4d8;
}

.dashboard-table a {
    color: #d4d4d8;
    text-decoration: none;
}

.dashboard-table a:hover {
    color: #22c55e;
}

.empty-list {
    color: #52525b;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Card Detail Navigation */
.card-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    max-width: 900px;
    margin: 1.5rem auto 0;
    padding: 0.75rem 1rem;
    background: #18181b;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.card-navigation .nav-btn {
    min-width: 100px;
}

.card-navigation .nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.card-position {
    color: #71717a;
    font-size: 0.9rem;
    min-width: 80px;
    text-align: center;
}

/* Card Detail Page */
.card-detail-container {
    max-width: 100%;
    margin: 0 auto;
}

.loading-state,
.error-state {
    text-align: center;
    padding: 3rem;
    color: #71717a;
}

.error-state {
    color: var(--terracotta);
}

.card-images {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.card-image-wrapper {
    text-align: center;
}

.card-detail-image {
    max-width: 280px;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.image-label {
    display: block;
    margin-top: 0.5rem;
    color: #52525b;
    font-size: 0.85rem;
}

.no-image-placeholder {
    width: 280px;
    height: 400px;
    background: var(--cream-dark);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #52525b;
}

.card-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--cream-dark);
}

.card-detail-title h1 {
    font-size: 1.75rem;
    color: white;
    margin: 0 0 0.25rem 0;
}

.card-detail-title .team-name {
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.card-detail-badges {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.detail-badge {
    height: 24px;
    width: auto;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: #18181b;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
}

.info-card h3 {
    color: white;
    font-size: 1rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--cream-dark);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--cream);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row.highlight {
    background: var(--cream);
    margin: 0.5rem -1.25rem 0;
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 8px 8px;
}

.info-label {
    color: #71717a;
}

.info-value {
    font-weight: 500;
    color: var(--text-dark);
}

.info-value.price-value {
    color: var(--gold);
    font-weight: 600;
}

.card-detail-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: #18181b;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.created-date {
    color: #52525b;
    font-size: 0.9rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

/* Card Links */
.card-image-link {
    display: block;
    text-decoration: none;
}

.card-link {
    color: white;
    text-decoration: none;
    transition: color 0.2s;
}

.card-link:hover {
    color: #22c55e;
}

/* Player Stats Section */
.player-stats-card {
    margin-bottom: 1.5rem;
}

.player-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--cream-dark);
}

.player-stats-header h3 {
    margin: 0;
    padding: 0;
    border: none;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.stats-loading,
.stats-error {
    padding: 1rem;
    text-align: center;
    color: #52525b;
}

.stats-error {
    color: var(--terracotta);
}

.stats-player-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    color: #71717a;
    font-size: 0.9rem;
}

.stats-position {
    background: var(--navy);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.stats-team {
    color: var(--sage);
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    text-align: center;
}

.stat-item {
    background: var(--cream);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #52525b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.stats-extra {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-extra-item {
    background: var(--cream-dark);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: #71717a;
}

.stats-note {
    color: #52525b;
    font-style: italic;
    font-size: 0.85rem;
}

.stats-setup-message {
    text-align: center;
    padding: 0.5rem;
}

.stats-setup-message p {
    margin-bottom: 0.75rem;
    color: #71717a;
}

/* Bulk Actions */
.bulk-actions-bar {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: #18181b;
    border: 1px solid #27272a;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
    z-index: 150;
    transition: bottom 0.3s ease;
}

.bulk-actions-bar.visible {
    bottom: 0;
}

.bulk-actions-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.bulk-selection-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.bulk-selection-info input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.bulk-actions-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Card Selection */
.card-select {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
    background: #18181b;
    border-radius: 4px;
    padding: 0.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.2s;
}

.card:hover .card-select,
.card.selected .card-select {
    opacity: 1;
}

.card-select input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.card.selected {
    outline: 3px solid var(--gold);
    outline-offset: -3px;
}

/* Table Selection */
.table-checkbox,
.table-checkbox-header {
    width: 40px;
    text-align: center;
}

.table-checkbox input[type="checkbox"],
.table-checkbox-header input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

tr.selected {
    background: rgba(201, 162, 39, 0.15) !important;
}

/* Responsive */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .team-form {
        flex-direction: column;
    }

    .bulk-actions-bar {
        left: 0;
        right: 0;
        transform: none;
        border-radius: 0;
    }

    .bulk-actions-content {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
}

/* ============ Collections Page ============ */

.collections-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

.collections-page .page-title {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.collections-table-container {
    background: #18181b;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.collections-table {
    width: 100%;
    border-collapse: collapse;
}

.collections-table th,
.collections-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--cream-dark);
}

.collections-table th {
    background: var(--navy);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.collections-table tbody tr {
    transition: background-color 0.15s;
}

.collection-row {
    cursor: pointer;
}

.collection-row:hover {
    background-color: var(--cream);
}

.collection-name {
    color: white;
}

.collections-table .text-center {
    text-align: center;
}

.collections-table .text-right {
    text-align: right;
}

.collections-page .loading-state,
.collections-page .empty-state {
    text-align: center;
    padding: 3rem;
    color: #71717a;
}

/* Sport Emoji */
.sport-emoji {
    font-size: 1.1rem;
    cursor: default;
}

/* ============ Modern Card Detail Page ============ */

.card-detail-content {
    animation: fadeIn 0.3s ease;
}

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

/* Hero Section */
.detail-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    background: #18181b;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

/* Image Carousel */
.image-carousel {
    position: relative;
    width: 280px;
    flex-shrink: 0;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 390px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #18181b;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: var(--navy);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: -22px;
}

.carousel-next {
    right: -22px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.carousel-dot {
    padding: 0.4rem 1rem;
    border: 2px solid var(--navy);
    border-radius: 20px;
    background: transparent;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.carousel-dot:hover {
    background: var(--cream);
}

.carousel-dot.active {
    background: var(--navy);
    color: white;
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--cream-dark) 0%, var(--cream) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #52525b;
    font-size: 0.9rem;
}

/* Main Info Panel */
.detail-main-info {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.detail-player-name {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
}

.detail-team-name {
    font-size: 1.1rem;
    color: var(--gold);
    font-weight: 600;
    margin: 0.25rem 0 0;
}

.status-lg {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.detail-badges {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.detail-badges img {
    height: 28px;
    width: auto;
    transition: transform 0.2s;
}

.detail-badges img:hover {
    transform: scale(1.1);
}

/* Quick Stats Pills */
.detail-quick-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.quick-stat {
    background: var(--cream);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-stat-label {
    font-size: 0.75rem;
    color: #52525b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

/* Price Hero */
.price-hero {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-top: 0.5rem;
}

.price-main {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
}

.price-profit {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    padding-left: 2rem;
    border-left: 1px solid rgba(255,255,255,0.2);
}

.profit-amount {
    font-size: 1.5rem;
    font-weight: 700;
}

.profit-amount.profit-positive {
    color: #4ade80;
}

.profit-amount.profit-negative {
    color: #f87171;
}

.profit-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
}

/* Actions */
.detail-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-outline-danger {
    background: transparent;
    border: 2px solid var(--terracotta);
    color: var(--terracotta);
}

.btn-outline-danger:hover {
    background: var(--terracotta);
    color: white;
}

.btn-xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
}

/* Details Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.detail-card {
    background: #18181b;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.detail-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.detail-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
    border-bottom: 1px solid var(--cream-dark);
}

.detail-card-header h3 {
    margin: 0;
    font-size: 1rem;
    color: white;
    flex: 1;
}

.detail-card-icon {
    font-size: 1.25rem;
}

.detail-card-body {
    padding: 1rem 1.25rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--cream);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #71717a;
    font-size: 0.9rem;
}

.detail-value {
    font-weight: 600;
    color: var(--text-dark);
}

.detail-value-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Compact Stats Grid */
.stats-grid-compact {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.stat-box {
    background: var(--cream);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.stat-lbl {
    display: block;
    font-size: 0.65rem;
    color: #52525b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.15rem;
}

/* Navigation Redesign */
.card-navigation {
    background: #18181b;
    border-radius: var(--radius-lg);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-md);
    margin-top: 2rem;
}

.card-navigation .nav-btn {
    min-width: 120px;
    transition: all 0.2s;
}

.card-navigation .nav-btn:not(:disabled):hover {
    background: var(--navy);
    transform: translateX(-3px);
}

.card-navigation .nav-btn:last-of-type:not(:disabled):hover {
    transform: translateX(3px);
}

.card-position {
    font-weight: 500;
    color: white;
}

/* Responsive */
@media (max-width: 900px) {
    .detail-hero {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .image-carousel {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .carousel-container {
        height: 440px;
    }

    .carousel-prev {
        left: 10px;
    }

    .carousel-next {
        right: 10px;
    }

    .price-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .price-profit {
        padding-left: 0;
        border-left: none;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255,255,255,0.2);
        width: 100%;
    }
}

@media (max-width: 600px) {
    .image-carousel {
        max-width: 260px;
    }

    .carousel-container {
        height: 360px;
    }

    .detail-player-name {
        font-size: 1.5rem;
    }

    .detail-actions {
        flex-wrap: wrap;
    }

    .stats-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============ Sell Signal Badges ============ */

.signal-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
    margin-left: 6px;
}

.signal-hot { background: rgba(239,68,68,0.12); color: #ef4444; }
.signal-rising { background: rgba(245,158,11,0.12); color: #f59e0b; }
.signal-stable { background: rgba(113,113,122,0.15); color: #71717a; }
.signal-declining { background: rgba(59,130,246,0.12); color: #3b82f6; }
.signal-buy { background: rgba(34,197,94,0.12); color: #22c55e; }

.signal-detail {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #18181b;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.signal-detail .signal-badge {
    font-size: 0.85rem;
    padding: 4px 12px;
}

.signal-detail .signal-text {
    font-size: 0.85rem;
    color: #71717a;
}

.signal-score {
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

/* ============ Price Chart ============ */

/* Signal Info Icon */
.signal-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 0.8rem;
    color: #52525b;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 4px;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
}

.signal-info-icon:hover {
    color: #22c55e;
    background: rgba(34,197,94,0.1);
}

/* Pulse Check */
.ai-advice-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #d4d4d8;
}

.ai-advice-text strong {
    color: #22c55e;
}

.price-chart-container {
    background: #18181b;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.price-chart-container h3 {
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--cream-dark);
}

.price-chart-container canvas {
    max-height: 300px;
}

/* ============ User Dropdown ============ */

.user-dropdown {
    position: relative;
}

.user-dropdown .btn-logout {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s;
}

.user-dropdown .btn-logout:hover {
    border-color: #22c55e;
    color: #22c55e;
}

.user-dropdown .btn-logout.dropdown-toggle::after {
    content: '';
    display: inline-block;
    margin-left: 0.4rem;
    border-top: 4px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    vertical-align: middle;
}

.user-dropdown .dropdown-menu {
    right: 0;
    left: auto;
    min-width: 160px;
}

/* ============ User Nav (legacy) ============ */

.user-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
}

.user-nav .username {
    color: var(--gold);
    font-size: 0.85rem;
    font-weight: 600;
}

.user-nav .btn-logout {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s;
}

.user-nav .btn-logout:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* ============ Price Trends Page ============ */

.signals-summary {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.signal-count-card {
    background: #18181b;
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.signal-count-card .count {
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.signal-count-card .label {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.signals-table {
    width: 100%;
    border-collapse: collapse;
    background: #18181b;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.signals-table th,
.signals-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--cream-dark);
}

.signals-table th {
    background: #111113;
    color: #71717a;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.signals-table tr:hover {
    background: #27272a;
    cursor: pointer;
}

@media (max-width: 768px) {
    .signals-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============ Tablet (iPad) ============ */
@media (max-width: 1024px) {
    header {
        padding: 0.5rem 1rem;
    }
    .header-nav {
        gap: 0.25rem;
    }
    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    main {
        padding: 1.5rem;
    }
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .lists-grid {
        grid-template-columns: 1fr;
    }
    .detail-hero {
        grid-template-columns: 200px 1fr;
        gap: 1.5rem;
    }
}

/* ============ Mobile ============ */
@media (max-width: 640px) {
    header {
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .logo-title {
        flex: 1;
    }
    .header-logo {
        height: 22px;
    }
    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.15rem;
    }
    .nav-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.72rem;
    }
    .header-actions {
        gap: 0.25rem;
    }
    .header-actions .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    .header-actions .dropdown {
        display: none;
    }
    .user-nav .username {
        display: none;
    }
    main {
        padding: 1rem 0.75rem;
    }
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    .card-info {
        padding: 0.6rem;
    }
    .card-player {
        font-size: 0.9rem;
    }
    .card-set {
        font-size: 0.75rem;
    }
    .card-actions {
        padding: 0.5rem;
        gap: 0.25rem;
    }
    .card-actions .btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    .view-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    .filter-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .filter-select, .filter-controls input {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        width: auto;
        flex: 1;
        min-width: 120px;
    }
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .detail-hero {
        grid-template-columns: 1fr;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .detail-actions {
        flex-wrap: wrap;
    }
    .dashboard-title, .page-title {
        font-size: 1.3rem;
    }
    .signals-summary {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .signal-count-card .count {
        font-size: 1.5rem;
    }
    .signals-table {
        font-size: 0.8rem;
    }
    .signals-table th, .signals-table td {
        padding: 0.5rem 0.5rem;
    }
    .scan-page .scan-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    .review-table {
        font-size: 0.75rem;
    }
    .review-table input {
        font-size: 0.75rem;
        padding: 0.25rem 0.35rem;
    }
    .price-chart-container {
        padding: 0.75rem;
    }
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
}
