/* MyTCGPortal Custom Styles */

/* GLOBAL DARK THEME - NO WHITE BACKGROUNDS */
body {
    background: #0f172a !important;
    color: #f1f5f9 !important;
}

/* All cards must be dark */
.card {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-header {
    background: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

.card-body {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

.card-footer {
    background: #0f172a !important;
    border-top: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3) !important;
}

/* Modal dark theme */
.modal-content {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

.modal-header {
    background: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

.modal-body {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

.modal-footer {
    background: #0f172a !important;
    border-top: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

/* Dropdown dark theme */
.dropdown-menu {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

.dropdown-item {
    color: #f1f5f9 !important;
}

.dropdown-item:hover {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

/* Form controls dark theme */
.form-control, .form-select {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

.form-control:focus, .form-select:focus {
    background: #0f172a !important;
    border-color: #3b82f6 !important;
    color: #f1f5f9 !important;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25) !important;
}

/* Input group dark theme */
.input-group-text {
    background: #334155 !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

/* List group dark theme */
.list-group-item {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

/* Accordion dark theme */
.accordion-item {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

.accordion-button {
    background: #0f172a !important;
    color: #f1f5f9 !important;
}

.accordion-button:not(.collapsed) {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

/* Alert dark theme */
.alert {
    border: none !important;
    border-radius: 0.5rem;
}

/* Toast dark theme */
.toast {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

.toast-header {
    background: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

/* Offcanvas dark theme */
.offcanvas {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

/* Pagination dark theme */
.page-link {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

.page-link:hover {
    background: #334155 !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

.page-item.active .page-link {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

/* Nav tabs dark theme */
.nav-tabs .nav-link {
    color: #94a3b8 !important;
    border-color: transparent transparent #334155 !important;
}

.nav-tabs .nav-link.active {
    background: #1e293b !important;
    border-color: #334155 #334155 #1e293b !important;
    color: #f1f5f9 !important;
}

/* Tooltip dark theme */
.tooltip-inner {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
    border-top-color: #334155 !important;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
    border-bottom-color: #334155 !important;
}

.tooltip.bs-tooltip-start .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
    border-left-color: #334155 !important;
}

.tooltip.bs-tooltip-end .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
    border-right-color: #334155 !important;
}

/* Popover dark theme */
.popover {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

.popover-header {
    background: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

.popover-body {
    color: #f1f5f9 !important;
}

/* Breadcrumb dark theme */
.breadcrumb {
    background: #1e293b !important;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #64748b !important;
}

.breadcrumb-item a {
    color: #3b82f6 !important;
}

/* Progress bar dark theme */
.progress {
    background: #0f172a !important;
}

/* Table dark theme */
.table {
    color: #f1f5f9 !important;
}

.table > :not(caption) > * > * {
    background: transparent !important;
    color: #f1f5f9 !important;
    border-bottom-color: #334155 !important;
}

.table-hover > tbody > tr:hover > * {
    background: rgba(51, 65, 85, 0.5) !important;
    color: #f1f5f9 !important;
}

/* Badge dark theme enhancement */
.badge {
    font-size: 0.75em;
}

/* Close button dark theme */
.btn-close {
    filter: invert(1) !important;
}

/* Spinner dark theme */
.spinner-border {
    color: #3b82f6 !important;
}

/* Brand styling */
.navbar-brand {
    font-size: 1.5rem;
}

/* Status badges */
.badge {
    font-size: 0.75em;
}

/* Progress bars */
.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Table improvements */
.table th {
    border-top: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 1rem 0.75rem;
}

.table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Modal improvements */
.modal-content {
    border: none;
    border-radius: 0.5rem;
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.125);
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.125);
}

/* Button improvements */
.btn {
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    font-size: 0.75rem;
}

/* Alert improvements */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Loading states */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Statistics cards */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-danger {
    border: none;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* File upload area */
.upload-area {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.upload-area.dragover {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

/* Pokemon type badges */
.type-normal { background-color: #A8A878; }
.type-fire { background-color: #F08030; }
.type-water { background-color: #6890F0; }
.type-electric { background-color: #F8D030; }
.type-grass { background-color: #78C850; }
.type-ice { background-color: #98D8D8; }
.type-fighting { background-color: #C03028; }
.type-poison { background-color: #A040A0; }
.type-ground { background-color: #E0C068; }
.type-flying { background-color: #A890F0; }
.type-psychic { background-color: #F85888; }
.type-bug { background-color: #A8B820; }
.type-rock { background-color: #B8A038; }
.type-ghost { background-color: #705898; }
.type-dragon { background-color: #7038F8; }
.type-dark { background-color: #705848; }
.type-steel { background-color: #B8B8D0; }
.type-fairy { background-color: #EE99AC; }

/* Responsive improvements */
@media (max-width: 768px) {
    .display-6 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        font-size: 0.875rem;
    }
}



/* Dark mode specific improvements */
[data-bs-theme="dark"] .card {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.125);
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
}

[data-bs-theme="dark"] .table-dark {
    --bs-table-bg: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .modal-content {
    background-color: var(--bs-dark);
    border: 1px solid rgba(255, 255, 255, 0.125);
}

/* Footer */
footer {
    margin-top: auto;
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bg-gradient {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-info) 100%);
}

/* Table sorting and filtering */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.sort-icon {
    width: 16px;
    height: 16px;
    opacity: 0.5;
    transition: opacity 0.2s ease, transform 0.2s ease;
    margin-left: 4px;
    vertical-align: middle;
    display: inline-block;
    vertical-align: middle;
    display: inline-block;
}

.sortable:hover .sort-icon {
    opacity: 0.8;
}

.sortable.sort-asc .sort-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.sortable.sort-desc .sort-icon {
    opacity: 1;
    transform: rotate(180deg);
}

/* Fix sort icon alignment with header text */
.sort-icon {
    vertical-align: middle !important;
    display: inline-block !important;
}

/* Ensure table headers have proper alignment */
.sortable {
    vertical-align: middle;
    text-align: left;
}

/* Fix feather icon alignment in navbar */
.navbar [data-feather] {
    vertical-align: middle !important;
    margin-top: -2px;
}

.navbar-text [data-feather] {
    vertical-align: middle !important;
    margin-top: -1px;
}

/* Fix navbar-text positioning issue */
.navbar-text {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    line-height: 1 !important;
}

/* Ensure navbar items are properly aligned */
.navbar-nav .nav-item {
    display: flex;
    align-items: center;
}

/* Compact styling */
.compact-card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.compact-card .card-header {
    padding: 0.75rem 1rem;
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    border-bottom: 1px solid rgba(var(--bs-border-color-rgb), 0.2);
}

.compact-card .card-body {
    padding: 1rem;
}

.table-compact {
    font-size: 0.875rem;
}

.table-compact th {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.table-compact td {
    padding: 0.5rem 0.75rem;
}

/* Card image styling */
.card-image {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
}

.no-image-placeholder {
    width: 40px;
    height: 56px;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    border-radius: 4px;
}

/* Badge styling */
.badge-sm {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
}

/* View toggle buttons */
.view-toggle .btn {
    border-radius: 0;
}

.view-toggle .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.view-toggle .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Stats cards */
.stats-card {
    background: rgba(var(--bs-light-rgb), 0.05);
    border: 1px solid rgba(var(--bs-border-color-rgb), 0.2);
    border-radius: 6px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.stats-card:hover {
    background: rgba(var(--bs-light-rgb), 0.1);
    transform: translateY(-1px);
}

.stats-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.stats-label {
    font-size: 0.75rem;
    color: var(--bs-text-muted);
    margin: 0;
}

/* Grid view */
.card-grid {
    display: grid;
    gap: 1rem;
}

/* Desktop and tablet: 4x1 layout */
@media (min-width: 768px) {
    .card-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile: 1 column layout */
@media (max-width: 767px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

.card-item {
    border: 1px solid rgba(var(--bs-border-color-rgb), 0.2);
    border-radius: 8px;
    padding: 1rem;
    background: rgba(var(--bs-light-rgb), 0.02);
    transition: all 0.2s ease;
}

.card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* View container */
.view-container {
    min-height: 200px;
}


/* Dark theme form controls */
.form-control, .form-select {
    background-color: #2d2d30 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.form-control:focus, .form-select:focus {
    background-color: #2d2d30 !important;
    border-color: #007bff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
    color: #ffffff !important;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.input-group-text {
    background-color: #1a1a1a !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Button improvements for dark theme */
.btn-outline-secondary {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.btn-outline-secondary:hover, .btn-outline-secondary.active {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: #ffffff !important;
}

.btn-outline-secondary:not(.active) {
    background-color: transparent !important;
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Table styling for dark theme */
.table {
    --bs-table-bg: transparent !important;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05) !important;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.075) !important;
    color: #ffffff !important;
}

.table th {
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.table td {
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* Card hover effects for card details modal */
.clickable-card:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

.grid-card-compact.clickable-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Old Pokemon Grid Cards - REMOVED - Using new CSS Grid layout in grid-style.css */

/* Price text styling */
.price-text {
    font-weight: 600;
}

/* Badge improvements */
.badge {
    font-weight: 500;
}

/* No image placeholder styling */
.no-image-placeholder {
    background-color: #374151 !important;
    color: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Compact card styling */
.compact-card {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.compact-card .card-header {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.compact-card .card-body {
    background-color: transparent !important;
    color: #ffffff !important;
}

/* Stats cards dark theme */
.stats-card {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.stats-card:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Text color fixes */
.text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Success button styling */
.btn-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: #ffffff !important;
}

.btn-success:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
}

/* Filter button on mobile */
.btn-outline-secondary.d-lg-none {
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Processing Log Cards */
.processing-log-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.processing-log-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Job ID Badge */
.job-id-badge {
    background: rgba(108, 117, 125, 0.3);
    color: #ffffff;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 0.75rem;
}

/* Status Badges */
.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.status-badge.completed {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-badge.processing {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-badge.failed {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.status-badge.pending {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

/* Duration Badge */
.duration-badge {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Date and Time Info */
.date-info {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.time-info {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Filename Section */
.filename-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 0.875rem;
}

.filename-text {
    color: #ffffff;
    font-family: 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    flex-grow: 1;
    line-height: 1.4;
}

.source-icon {
    flex-shrink: 0;
}

.warning-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* Progress Section */
.progress-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 0.875rem;
}

.progress-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
}

.progress-numbers {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
}

.progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 0.25rem;
    transition: width 0.3s ease;
}

/* Mobile Responsiveness */
@media (max-width: 767px) {
    .processing-log-card {
        padding: 1rem;
    }
    
    .date-info {
        flex-direction: column;
        align-items: flex-end;
        font-size: 0.8rem;
    }
    
    .time-info {
        margin-left: 0;
        margin-top: 0.125rem;
    }
    
    .filename-text {
        font-size: 0.8rem;
    }
    
    .status-badge, .job-id-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .duration-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}
}
