/* Custom styles for MTG Arena Deck Statistics */

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Navbar styling */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Card styling */
.card {
    border: none;
    border-radius: 0.5rem;
}

.card-header {
    border-radius: 0.5rem 0.5rem 0 0 !important;
    font-weight: 600;
}

/* Mana symbols */
.mana-symbols {
    display: inline-flex;
    gap: 0.15rem;
    align-items: center;
}

.mana-symbols .ms-cost {
    font-size: 1.3em;
}

/* DataTables customization */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_filter input {
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
}

.dataTables_length select {
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
}

/* Table styling */
#decksTable {
    font-size: 0.95rem;
}

#decksTable thead th {
    background-color: #343a40;
    color: white;
    border: none;
    font-weight: 600;
    vertical-align: middle;
}

#decksTable tbody tr {
    transition: background-color 0.2s ease;
}

#decksTable tbody tr:hover {
    background-color: #f1f3f5;
    cursor: pointer;
}

#decksTable tbody tr.shown {
    background-color: #e9ecef;
}

/* Expandable row styling */
.details-control {
    cursor: pointer;
    text-align: center;
    font-size: 1.2rem;
    color: #0d6efd;
    width: 30px;
}

.details-control:hover {
    color: #0a58ca;
}

.details-control::before {
    content: '⊕';
}

tr.shown .details-control::before {
    content: '⊖';
}

.deck-details {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-left: 4px solid #0d6efd;
}

.deck-details h5 {
    color: #0d6efd;
    margin-bottom: 1rem;
    font-weight: 600;
}

.card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
}

.card-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background-color: white;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
    font-size: 0.9rem;
}

.card-item .card-name {
    font-weight: 500;
    color: #212529;
}

.card-item .card-quantity {
    font-weight: bold;
    color: #6c757d;
    min-width: 30px;
    text-align: right;
}

/* Winrate styling */
.winrate-high {
    color: #198754;
    font-weight: bold;
}

.winrate-medium {
    color: #fd7e14;
    font-weight: bold;
}

.winrate-low {
    color: #dc3545;
    font-weight: bold;
}

/* Statistics cards */
#statsRow .card {
    transition: transform 0.2s ease;
}

#statsRow .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-list {
        grid-template-columns: 1fr;
    }

    #decksTable {
        font-size: 0.85rem;
    }

    .mana-symbols {
        flex-wrap: wrap;
    }
}

/* Link styling in table */
.deck-link {
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.9rem;
}

.deck-link:hover {
    text-decoration: underline;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Trend indicators */
.trend-icon {
    font-size: 1.5rem;
    font-weight: bold;
    display: inline-block;
    width: 30px;
    text-align: center;
}

.trend-up {
    color: #198754;
}

.trend-down {
    color: #dc3545;
}

.trend-stable {
    color: #6c757d;
}

.trend-new {
    color: #ffc107;
    text-shadow: 0 0 3px rgba(255, 193, 7, 0.5);
}

/* Evolution timeline */
.evolution-timeline {
    background-color: white;
    padding: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
}

.evolution-timeline .table {
    margin-bottom: 0;
}

.evolution-timeline thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.9rem;
}

.evolution-timeline tbody td {
    font-size: 0.9rem;
    vertical-align: middle;
}

.evolution-timeline tbody tr:hover {
    background-color: #f8f9fa;
}

/* Single Date Mode switch */
.form-switch .form-check-input {
    cursor: pointer;
    width: 3rem;
    height: 1.5rem;
}

.form-switch .form-check-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    margin-left: 0.5rem;
}

/* Chart View Styles */
#chartView {
    min-height: 400px;
}

.chart-container {
    position: relative;
    margin-bottom: 2rem;
}

.deck-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
}

.deck-selector .form-check {
    min-width: 200px;
}

.deck-color-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* View Toggle Buttons */
#viewToggle {
    margin-left: auto;
}

#viewToggle .btn-check:checked + label {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Metric Toggle Buttons */
.btn-group input[type="radio"]:checked + label {
    background-color: #0d6efd;
    color: white;
}

/* Chart Message Area */
#chartMessage {
    margin-bottom: 1rem;
}

/* Export button - hide any ::before content */
.export-arena-btn::before {
    content: none !important;
    display: none !important;
}

/* Responsive chart adjustments */
@media (max-width: 768px) {
    .chart-container {
        height: 350px !important;
    }

    .deck-selector {
        max-height: 150px;
    }

    .deck-selector .form-check {
        min-width: 100%;
    }
}
