/* ========== Base Styles ========== */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #1abc9c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
    --red-roulette: #e74c3c;
    --black-roulette: #2c3e50;
    --green-roulette: #2ecc71;
    
    --transition-speed: 0.3s;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========== Header Styles ========== */
.header {
    background-color: var(--secondary-color);
    color: white;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* ========== Roulette Table Styles ========== */
.roulette-table-container {
    overflow-x: auto;
    margin-top: 1rem;
    padding: 1rem;
}

#roulette-table {
    border-collapse: separate;
    border-spacing: 5px;
    margin: 0 auto;
}

#roulette-table td {
    width: 60px;
    height: 60px;
    text-align: center;
    color: white;
    font-weight: bold;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    box-shadow: var(--box-shadow);
    user-select: none;
}

#roulette-table td:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

#roulette-table td:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.red {
    background-color: var(--red-roulette);
}

.black {
    background-color: var(--black-roulette);
}

.green {
    background-color: var(--green-roulette);
}

/* ========== History Styles ========== */
.roulette-history {
    width: 100%;
    padding: 0.5rem;
}

#history-input {
    font-size: 1rem;
    padding: 0.5rem;
    background-color: var(--light-color);
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
}

#spin-count {
    background-color: var(--secondary-color);
    color: white;
    font-size: 1rem;
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== Statistics Styles ========== */
.stats-container {
    width: 100%;
}

.stats-details {
    display: none;
    padding: 1rem;
    background-color: #ffffff;
}

.stats-details.show {
    display: block;
}

.stat-box {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
}

.stat-box .progress {
    height: 0.5rem;
    border-radius: 10px;
    background-color: #e9ecef;
}

.stat-box .progress-bar {
    border-radius: 10px;
}

/* Styles pour les dots des statistiques */
.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

.stat-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #212529;
    font-weight: 500;
}

.red-dot {
    background-color: var(--red-roulette);
}

.black-dot {
    background-color: var(--black-roulette);
}

.even-dot {
    background-color: #0d6efd;
}

.odd-dot {
    background-color: #6c757d;
}

.small-dot {
    background-color: #0dcaf0;
}

.big-dot {
    background-color: #ffc107;
}

/* Style pour le conteneur des statistiques détaillées */
.stats-details.show {
    display: block;
    background-color: #fff;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.stats-details .stat-group {
    margin-bottom: 1rem;
}

.stats-details .stat-group-title {
    font-weight: 600;
    color: #212529 !important;
    margin-bottom: 0.5rem;
}

.stats-details .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    color: #212529 !important;
}

.stats-details .stat-item-label {
    display: flex;
    align-items: center;
    color: #212529 !important;
}

.stats-details .stat-item-value {
    font-weight: 500;
    color: #212529 !important;
}

.stat-value {
    color: #212529 !important;
}

.stat-label {
    color: #495057 !important;
}

.stat-row {
    color: #212529 !important;
}

/* Mode sombre pour les statistiques */
@media (prefers-color-scheme: dark) {
    .stats-details.show {
        background-color: #ffffff;
    }

    .stats-details .stat-group-title {
        color: #212529 !important;
    }

    .stats-details .stat-item {
        background-color: #f8f9fa;
        color: #212529 !important;
    }

    .stat-value {
        color: #212529 !important;
    }

    .stat-label {
        color: #495057 !important;
    }

    .stat-row {
        color: #212529 !important;
    }
}

/* ========== Methods Styles ========== */
.methods-container {
    max-height: calc(100vh - 400px);
    overflow-y: auto;
    padding: 1rem;
}

.method-item {
    background-color: var(--bs-light);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--bs-gray-200);
}

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

.method-item.has-alert {
    border-color: var(--bs-danger);
}

.method-item .method-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.method-item .method-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.method-item .method-stats {
    font-size: 0.875rem;
}

.method-item .stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.method-item .gap-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.method-item .progress {
    height: 0.5rem;
    margin-bottom: 0.5rem;
}

.method-item .gap-history {
    display: flex;
    gap: 0.25rem;
}

.method-item .gap-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.method-item .gap-0 {
    background-color: var(--bs-success);
    color: white;
}

.method-item .gap-1 {
    background-color: var(--bs-info);
    color: white;
}

.method-item .gap-2 {
    background-color: var(--bs-warning);
    color: white;
}

.method-item .gap-3 {
    background-color: var(--bs-danger);
    color: white;
}

.method-item .gap-high {
    background-color: var(--bs-dark);
    color: white;
}

.method-item .badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* ========== Modal Styles ========== */
.detail-stat-box {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
}

.detail-stat-label {
    font-size: 0.85rem;
    color: var(--gray-color);
    margin-bottom: 0.25rem;
}

.detail-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.gap-history-container {
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.gap-history {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gap-item {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: bold;
}

.gap-0 {
    background-color: #28a745;
    color: white;
}

.gap-1 {
    background-color: #17a2b8;
    color: white;
}

.gap-2 {
    background-color: #ffc107;
    color: black;
}

.gap-3 {
    background-color: #fd7e14;
    color: white;
}

.gap-high {
    background-color: #dc3545;
    color: white;
}

/* ========== Footer Styles ========== */
.footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 1rem 0;
    margin-top: auto;
}

/* ========== Responsive Styles ========== */
@media (max-width: 576px) {
    .main-content {
        padding: 1rem 0;
    }
    
    #roulette-table td {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .detail-stat-value {
        font-size: 1.5rem;
    }
}

@media (min-width: 768px) {
    #roulette-table td {
        width: 50px;
        height: 50px;
    }
}

@media (min-width: 992px) {
    #roulette-table td {
        width: 60px;
        height: 60px;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 1s ease-in-out;
}

/* Utility Classes */
.shadow-sm {
    box-shadow: var(--box-shadow) !important;
}

.card {
    border-radius: var(--border-radius);
    border: none;
    overflow: hidden;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    padding: 1rem;
}

.btn {
    border-radius: var(--border-radius);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0, 0, 0, 0.125);
}

.list-group-item {
    border-left: none;
    border-right: none;
}

.list-group-item:first-child {
    border-top: none;
}

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

/* Styles pour les cartes de méthodes */
.methods-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.method-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.method-card.playable {
    border: 2px solid #28a745;
    transform: translateY(-2px);
}

.method-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

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

.method-card .stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.method-card .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.method-card .stat-label {
    font-size: 0.875rem;
    color: #6c757d;
}

.method-card .stat-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #212529;
}

/* Dark mode */
[data-theme="dark"] .method-card {
    background-color: #2d3436;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .method-card .card-header {
    border-bottom-color: #4a4a4a;
}

[data-theme="dark"] .method-card .stat-item {
    background-color: #4a4a4a;
}

[data-theme="dark"] .method-card .stat-label {
    color: #b2bec3;
}

[data-theme="dark"] .method-card .stat-value {
    color: #dfe6e9;
}

/* Badge "À jouer" */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.bg-success {
    background-color: #28a745;
    color: white;
}

/* Mode sombre */
.dark-mode .method-card {
    background: #2d2d2d;
    color: #fff;
}

.dark-mode .method-card.playable {
    border-color: #28a745;
    background: #1a2d1a;
}

.dark-mode .method-header {
    border-bottom-color: #444;
}

.dark-mode .method-header h3 {
    color: #fff;
}

.dark-mode .gap-info,
.dark-mode .ratio-info,
.dark-mode .gap-history {
    background: #3d3d3d;
}

.dark-mode .history-title {
    color: #ccc;
}

.dark-mode .history-content {
    color: #ccc;
}

/* Styles pour les méthodes */
.methods-container {
    max-height: 600px;
    overflow-y: auto;
}

.method-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.method-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.method-item.playable {
    border-left: 4px solid #28a745;
}

.method-item:not(.playable) {
    opacity: 0.7;
}

.method-stats {
    font-size: 0.9rem;
    color: #333;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    color: #333;
}

.gap-info {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    color: #333;
}

.numbers-to-play {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}

.numbers-to-play strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #495057;
}

.numbers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.number-badge {
    background-color: #f0f0f0;
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 2px;
    white-space: nowrap;
}

.number-badge:hover {
    background-color: #dee2e6;
}

.stat-box {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
    padding: 0.5rem;
    text-align: center;
}

.stat-label {
    color: #6c757d;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Styles pour les statistiques */
.stats-details {
    display: none;
    padding: 1rem;
    background-color: #ffffff;
}

.stats-details.show {
    display: block;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.red-dot {
    background-color: #dc3545;
}

.black-dot {
    background-color: #212529;
}

.even-dot {
    background-color: #0d6efd;
}

.odd-dot {
    background-color: #6c757d;
}

.small-dot {
    background-color: #0dcaf0;
}

.big-dot {
    background-color: #ffc107;
}

/* Styles pour les barres de progression */
.progress {
    height: 6px;
    margin-top: 0.5rem;
}

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

/* Styles pour les badges */
.badge {
    font-size: 0.8rem;
    padding: 0.35em 0.65em;
}

.badge.bg-danger {
    animation: pulse 2s infinite;
}

/* Styles pour le mode sombre */
@media (prefers-color-scheme: dark) {
    .method-item:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    .stat-box {
        background-color: rgba(255, 255, 255, 0.02);
    }
    
    .stat-label {
        color: #adb5bd;
    }
    
    .stat-value {
        color: #fff;
    }
}

.gap-history-section {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}

.gap-history-title {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.gap-history {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.gap-badge {
    color: #333;
    font-weight: 500;
}

/* ========== Mobile Styles ========== */
@media (max-width: 768px) {
    .roulette-table td {
        width: 55px !important;
        height: 55px !important;
        font-size: 1.3rem !important;
        padding: 0 !important;
        margin: 2px !important;
    }

    .roulette-table td.clickable {
        cursor: pointer;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .roulette-table td.clickable:active {
        transform: scale(0.95);
    }

    .roulette-table-container {
        padding: 0.5rem;
        margin: 0 -0.5rem;
    }

    #roulette-table {
        border-spacing: 3px;
    }

    .method-stats {
        font-size: 1rem;
    }

    .stats-row, .gap-info {
        font-size: 1rem;
        margin: 10px 0;
    }

    .numbers-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
        gap: 8px;
        margin-top: 8px;
    }

    .number-badge {
        width: 100%;
        min-width: 45px;
        height: 45px;
        font-size: 1.1rem;
        padding: 0;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .gap-badge {
        font-size: 1rem;
        padding: 4px 8px;
        margin: 0 4px;
    }
}

/* ========== Mobile Animations ========== */
.mobile-pulse {
    animation: mobilePulse 0.5s ease-in-out;
}

@keyframes mobilePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ========== Toast Notifications ========== */
.toast-container {
    z-index: 1050;
    max-width: 300px;
    max-height: 200px;
    overflow-y: auto;
}

.toast {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.toast.show {
    opacity: 1;
}

.toast-body {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    line-height: 1.2;
}

.toast .btn-close {
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
}

/* Style spécifique pour les notifications sur mobile */
@media (max-width: 768px) {
    .toast-container {
        max-width: 90%;
        left: 5%;
        right: 5%;
        bottom: 1rem;
    }
    
    .toast {
        margin-bottom: 0.25rem;
    }
    
    .toast-body {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* ========== Touch Feedback ========== */
@media (hover: none) {
    #roulette-table td:active {
        transform: scale(0.95);
    }
    
    .method-item:active {
        transform: scale(0.98);
    }
} 