/* Main CSS for Pokemon TCG Pocket Simulator */

.results-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.result-item {
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

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

#collectionChart {
    height: 500px !important;
    max-height: 500px;
}

.loading {
    position: relative;
    min-height: 200px;
}

.loading::after {
    content: attr(data-progress);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
    color: #6c757d;
}

.progress {
    display: none;
}

.loading .progress {
    display: block;
    margin-top: 20px;
}

/* Custom styling for evolve simulator */
.btn-group .btn {
    transition: all 0.3s ease;
}

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

.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.form-control-lg {
    border-radius: 8px;
}

.btn-lg {
    border-radius: 8px;
    font-weight: 600;
}

.badge {
    border-radius: 20px;
}

/* Mobile Navigation Tabs Optimization */
#simTabs {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0;
    margin-bottom: 1rem;
}

#simTabs .nav-link {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: fit-content;
}

#simTabs .nav-link:hover {
    color: #495057;
    background-color: #f8f9fa;
    border-bottom-color: #dee2e6;
}

#simTabs .nav-link.active {
    color: #0d6efd;
    background-color: transparent;
    border-bottom-color: #0d6efd;
    font-weight: 600;
}

#simTabs .nav-link i {
    font-size: 0.875rem;
}

/* Mobile-specific tab improvements */
@media (max-width: 576px) {
    #simTabs {
        margin: 0 -0.5rem 1rem -0.5rem;
        padding: 0 0.5rem;
    }
    
    #simTabs .nav-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
        min-width: 60px;
        text-align: center;
    }
    
    #simTabs .nav-link i {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    #simTabs .nav-link {
        padding: 0.25rem 0.375rem;
        font-size: 0.75rem;
        min-width: 50px;
    }
    
    #simTabs .nav-link i {
        font-size: 0.7rem;
    }
}

/* Hide scrollbar but keep functionality */
#simTabs::-webkit-scrollbar {
    display: none;
}

#simTabs {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Multi-Run Statistics Table Alignment */
#multiRunStats .table th,
#multiRunStats .table td {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    padding: 0.5rem 0.25rem;
}

#multiRunStats .table th:first-child,
#multiRunStats .table td:first-child {
    text-align: left;
}

#multiRunStats .table th:nth-child(n+2),
#multiRunStats .table td:nth-child(n+2) {
    text-align: right;
    font-family: 'Courier New', monospace;
    min-width: 60px;
}

/* Ensure consistent column widths */
#multiRunStats .table {
    table-layout: fixed;
}

#multiRunStats .table th:nth-child(1),
#multiRunStats .table td:nth-child(1) {
    width: 25%;
}

#multiRunStats .table th:nth-child(2),
#multiRunStats .table td:nth-child(2) {
    width: 20%;
}

#multiRunStats .table th:nth-child(3),
#multiRunStats .table td:nth-child(3) {
    width: 15%;
}

#multiRunStats .table th:nth-child(4),
#multiRunStats .table td:nth-child(4) {
    width: 15%;
}

#multiRunStats .table th:nth-child(5),
#multiRunStats .table td:nth-child(5) {
    width: 25%;
}

/* Responsive Table Optimizations */
@media (max-width: 768px) {
    /* Mobile optimizations for all tables */
    .table-responsive {
        border: none;
        box-shadow: none;
    }
    
    .table {
        font-size: 0.875rem;
        margin-bottom: 0;
    }
    
    .table th,
    .table td {
        padding: 0.375rem 0.25rem;
        border-width: 1px;
    }
    
    /* Multi-Run Statistics mobile layout */
    #multiRunStats .table th,
    #multiRunStats .table td {
        font-size: 0.75rem;
        padding: 0.25rem 0.125rem;
        white-space: nowrap;
    }
    
    #multiRunStats .table th:nth-child(n+2),
    #multiRunStats .table td:nth-child(n+2) {
        min-width: 50px;
        font-size: 0.7rem;
    }
    
    /* Stack tables vertically on mobile */
    #multiRunStatsContainer .col-md-6 {
        margin-bottom: 1rem;
    }
    
    /* Card Distribution tables mobile optimization */
    .table th,
    .table td {
        font-size: 0.8rem;
        padding: 0.3rem 0.2rem;
    }
    
    /* Evolution Probability table mobile optimization */
    #evolveProbabilityTable .table th,
    #evolveProbabilityTable .table td {
        font-size: 0.75rem;
        padding: 0.25rem 0.15rem;
    }
}

@media (max-width: 576px) {
    /* Extra small screens */
    .table {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.25rem 0.1rem;
    }
    
    #multiRunStats .table th,
    #multiRunStats .table td {
        font-size: 0.65rem;
        padding: 0.2rem 0.1rem;
    }
    
    #multiRunStats .table th:nth-child(n+2),
    #multiRunStats .table td:nth-child(n+2) {
        min-width: 40px;
        font-size: 0.6rem;
    }
    
    /* Make tables more compact */
    .table-responsive {
        margin: 0 -0.5rem;
    }
}

/* Desktop optimizations */
@media (min-width: 1200px) {
    .table {
        font-size: 0.95rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    #multiRunStats .table th,
    #multiRunStats .table td {
        padding: 0.6rem 0.4rem;
    }
}

/* Additional mobile optimizations */
@media (max-width: 992px) {
    /* Tablet and smaller desktop */
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .card-body {
        padding: 1rem 0.75rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Mobile-specific table improvements */
@media (max-width: 768px) {
    /* Horizontal scroll for tables on very small screens */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
    }
    
    /* Better spacing for mobile */
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .mt-4 {
        margin-top: 1rem !important;
    }
    
    /* Compact form controls */
    .form-control {
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }
    
    .form-select {
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }
    
    /* Better button sizing */
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
}

/* Print optimizations */
@media print {
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.3rem 0.2rem;
        border: 1px solid #000;
    }
    
    .table-responsive {
        overflow: visible;
    }
    
    /* Hide non-essential elements when printing */
    .btn, .form-control, .form-select {
        display: none;
    }
}
