/* Mobile Mode Styles */
.mobile-mode body {
    font-size: 1.15em;
    padding: 0.5rem;
}
.mobile-mode .container, .mobile-mode .container-fluid {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
.mobile-mode .navbar, .mobile-mode .sidebar, .mobile-mode #sidebar {
    font-size: 1.1em;
    padding: 0.5rem 0.5rem;
    min-width: 0;
    width: 100%;
    box-shadow: none;
    display: none !important;
}
.mobile-mode .card {
    margin-bottom: 1.2rem;
    box-shadow: var(--shadow-card);
}
.mobile-mode .btn, .mobile-mode button {
    font-size: 1.1em;
    padding: 0.75em 1.25em;
    border-radius: 0.7em;
}
.mobile-mode .form-control {
    font-size: 1.1em;
    padding: 0.7em 1em;
}
.mobile-mode .alert {
    font-size: 1.05em;
    padding: 0.7em 1em;
}
.mobile-mode .hero-section, .mobile-mode .hero-title {
    font-size: 2em;
    padding: 1.5em 0.5em;
}
.mobile-mode .stat-box {
    font-size: 1.1em;
    margin-bottom: 0.5em;
}
.mobile-mode .d-none.d-md-block {
    display: none !important;
}
.mobile-mode .d-md-none {
    display: block !important;
}
/* TCG Trading Website - Dark Theme */

:root {
    /* Dark Theme Colors */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #1c2128;
    --bg-hover: #30363d;
    
    /* Text Colors */
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    /* Accent Colors */
    --accent-primary: #58a6ff;
    --accent-secondary: #f85149;
    --accent-success: #3fb950;
    --accent-warning: #d29922;
    --accent-info: #79c0ff;
    
    /* TCG Game Colors */
    --magic-blue: #0e68ab;
    --pokemon-yellow: #ffcb05;
    --yugioh-purple: #663399;
    --wow-orange: #f4a460;
    
    /* Borders */
    --border-primary: #30363d;
    --border-secondary: #21262d;
    
    /* Shadows */
    --shadow-card: 0 4px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* Base Styles */
body {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: var(--bg-secondary) !important;
    border-bottom: 2px solid var(--border-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* User Info Section */
.user-info-section {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-card);
}

.user-info-section .username {
    color: var(--text-primary);
    font-size: 0.9rem;
    max-width: 120px;
}

.user-info-section .user-stats {
    line-height: 1.2;
}

.user-info-section .user-stats i {
    width: 12px;
    margin-right: 4px;
}

.coins-display {
    color: var(--accent-warning);
    font-size: 0.9rem;
}

.user-avatar i {
    color: var(--accent-primary) !important;
}

/* Game Badge Colors */
.game-badge.magic-blue {
    background: linear-gradient(135deg, #0e68ab, #1e78bb);
    color: white;
}

.game-badge.pokemon-yellow {
    background: linear-gradient(135deg, #ffcb05, #ffd700);
    color: #333;
}

.game-badge.yugioh-purple {
    background: linear-gradient(135deg, #663399, #7744aa);
    color: white;
}

.game-badge.lorcana-blue {
    background: linear-gradient(135deg, #4a90e2, #5ba0f2);
    color: white;
}

.game-badge.onepiece-red {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

.game-badge.dragonball-orange {
    background: linear-gradient(135deg, #ea580c, #f97316);
    color: white;
}

.game-badge.ff-purple {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
}

.game-badge.fab-red {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
    color: white;
}

.game-badge.ws-pink {
    background: linear-gradient(135deg, #ec4899, #f472b6);
    color: white;
}

.game-badge.vanguard-green {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.game-badge.archive-gold {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: white;
}

.game-badge.shadowverse-purple {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    color: white;
}

.game-badge.starwars-blue {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: white;
}

.game-badge.digimon-orange {
    background: linear-gradient(135deg, #ea580c, #f97316);
    color: white;
}

.game-badge.default-gray {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: white;
}

/* Clickable game styling */
.clickable-game {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clickable-game:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Image Placeholder Styling */
.image-placeholder .placeholder-bg {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.inventory-card .image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-brand {
    color: var(--accent-primary) !important;
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--accent-primary) !important;
}

/* Cards */
.card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    background: var(--bg-tertiary) !important;
    border-bottom: 1px solid var(--border-primary) !important;
    color: var(--text-primary) !important;
}

.card-body {
    color: var(--text-primary) !important;
}

/* Buttons */
.btn-primary {
    background: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
    color: white !important;
}

.btn-primary:hover {
    background: #4493e6 !important;
    border-color: #4493e6 !important;
}

.btn-success {
    background: var(--accent-success) !important;
    border-color: var(--accent-success) !important;
}

.btn-info {
    background: var(--accent-info) !important;
    border-color: var(--accent-info) !important;
    color: var(--bg-primary) !important;
}

.btn-warning {
    background: var(--accent-warning) !important;
    border-color: var(--accent-warning) !important;
    color: var(--bg-primary) !important;
}

.btn-danger {
    background: var(--accent-secondary) !important;
    border-color: var(--accent-secondary) !important;
}

/* Forms */
.form-control {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-primary) !important;
    color: var(--text-primary) !important;
}

/* Ensure form labels align consistently above inputs (fix shifted labels on contact form) */
.form-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.card .form-label {
    /* Ensure labels inside cards don't float or align horizontally */
    display: block;
}

/* Contact page specific fixes to prevent label/input shifting */
.contact-page .row > .col-md-6,
.contact-page .row > .col-12 {
    display: flex;
    flex-direction: column;
}
.contact-page .mb-3 {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.contact-page .form-control,
.contact-page .form-select {
    width: 100%;
    box-sizing: border-box;
}
.contact-page label.form-label {
    margin-bottom: 0.35rem;
}

/* Ensure the contact page content has a small border/gutter away from the viewport edges */
.contact-page {
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

/* Header inset specifically for contact page (prevents header sitting flush to card edge) */
.contact-page .canard-header {
    padding: 0.75rem 1rem;
    box-sizing: border-box;
}
.contact-page .canard-header p.mb-0 {
    margin-bottom: 0.5rem;
}

.form-control:focus {
    background: var(--bg-tertiary) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, 0.25) !important;
    color: var(--text-primary) !important;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

/* Tables */
.table {
    color: var(--text-primary) !important;
}

.table-dark {
    background: var(--bg-card) !important;
}

.table-dark th,
.table-dark td {
    border-color: var(--border-primary) !important;
}

/* TCG Game Badges */
.game-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0.25rem;
}

.game-badge.magic {
    background: linear-gradient(45deg, var(--magic-blue), #1e88e5);
    color: white;
}

.game-badge.pokemon {
    background: linear-gradient(45deg, var(--pokemon-yellow), #ffd54f);
    color: #333;
}

.game-badge.yugioh {
    background: linear-gradient(45deg, var(--yugioh-purple), #8e24aa);
    color: white;
}

.game-badge.wow {
    background: linear-gradient(45deg, var(--wow-orange), #ff8a65);
    color: white;
}

.game-badge.default {
    background: linear-gradient(45deg, var(--accent-info), #64b5f6);
    color: var(--bg-primary);
}

/* TCG Card Image Styling */
.card-image {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
    max-width: 100%;
    height: auto;
}

.card-image:hover {
    transform: scale(1.05);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 4rem 0;
    text-align: center;
    border-bottom: 2px solid var(--border-primary);
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Game Logo Grid */
.game-logos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.game-logo {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 200px; /* ensure enough room for tall card-back thumbnails */
}

.game-logo:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.game-logo img {
    max-width: 80px;
    max-height: 60px;
    margin-bottom: 0.5rem;
}

/* Game back images - fixed, consistent size with object-fit to avoid distortion */
.game-back-img {
    width: 100px; /* width to use for all game back thumbnails */
    height: 140px; /* height to use for all game back thumbnails */
    object-fit: contain; /* show full height without cropping */
    background: var(--bg-card); /* letterbox color for contained images */
    border-radius: 6px;
    display: block;
    margin-bottom: 0.5rem;
}

/* Override earlier generic img constraints for these thumbnail images */
.game-logo .game-back-img {
    max-width: none;
    max-height: none;
}

.game-logo-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Stats Cards */
.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px; /* ensure consistent height across all stat cards */
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-primary);
    display: block;
}

.stats-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Alerts */
.alert-info {
    background: rgba(121, 192, 255, 0.1) !important;
    border-color: var(--accent-info) !important;
    color: var(--accent-info) !important;
}

.alert-success {
    background: rgba(63, 185, 80, 0.1) !important;
    border-color: var(--accent-success) !important;
    color: var(--accent-success) !important;
}

.alert-warning {
    background: rgba(210, 153, 34, 0.1) !important;
    border-color: var(--accent-warning) !important;
    color: var(--accent-warning) !important;
}

.alert-danger {
    background: rgba(248, 81, 73, 0.1) !important;
    border-color: var(--accent-secondary) !important;
    color: var(--accent-secondary) !important;
}

/* Loading Spinner */
.loading-spinner {
    border: 3px solid var(--border-primary);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .game-logos {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .stats-number {
        font-size: 2rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Equalize top sections across pages: make cards in a row match height */
.equal-top-row {
    /* Bootstrap rows are flex containers; ensure children stretch */
    align-items: stretch;
}
.equal-top-row .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.equal-top-row .card .card-body {
    /* Let body take remaining space so footers/headers keep size */
    flex: 1 1 auto;
}
.equal-top-row .card .card-header,
.equal-top-row .card .card-footer {
    flex: 0 0 auto;
}