/*
 * Générateur Aléatoire - Styles
 * Version: 1.2.9
 */

.generateur-aleatoire-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Onglets */
.generateur-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.tab-button {
    flex: 1;
    padding: 1rem 2rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.tab-button:hover::before {
    width: 300px;
    height: 300px;
}

.tab-button:hover {
    color: #fff;
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Contenu des onglets */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Conteneurs principaux */
.roue-container,
.des-container,
.tirage-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #667eea;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
}

/* Contrôles */
.roue-controls,
.des-controls,
.tirage-controls {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.input-group-full {
    width: 100%;
}

.input-group label {
    color: #555;
    font-weight: 600;
    font-size: 0.95rem;
}

.input-group input {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #fff;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fff;
    resize: vertical;
}

.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Roue des nombres */
.roue-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    min-height: 250px;
}

.roue-wheel {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
    position: relative;
    transition: transform 0.5s ease;
}

.roue-wheel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    height: 90%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
}

.roue-wheel.spinning {
    animation: spin 2s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

@keyframes spin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(1800deg) scale(1.1);
    }
    100% {
        transform: rotate(3600deg) scale(1);
    }
}

.roue-number {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Affichage des dés */
.des-display {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    min-height: 150px;
    flex-wrap: wrap;
}

.dice {
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    position: relative;
    transition: transform 0.3s ease;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 10px;
    gap: 5px;
}

.dice:hover {
    transform: translateY(-5px);
}

.dice.rolling {
    animation: roll 1s ease;
}

@keyframes roll {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        transform: rotate(180deg) scale(0.9);
    }
    75% {
        transform: rotate(270deg) scale(1.1);
    }
}

/* Points des dés */
.dice-pip {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Face 1 - centre */
.dice.face-1 .dice-pip {
    grid-column: 2;
    grid-row: 2;
}

/* Face 2 - diagonale */
.dice.face-2 .dice-pip:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.dice.face-2 .dice-pip:nth-child(2) {
    grid-column: 3;
    grid-row: 3;
}

/* Face 3 - diagonale avec centre */
.dice.face-3 .dice-pip:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.dice.face-3 .dice-pip:nth-child(2) {
    grid-column: 2;
    grid-row: 2;
}

.dice.face-3 .dice-pip:nth-child(3) {
    grid-column: 3;
    grid-row: 3;
}

/* Face 4 - coins */
.dice.face-4 .dice-pip:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.dice.face-4 .dice-pip:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
}

.dice.face-4 .dice-pip:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
}

.dice.face-4 .dice-pip:nth-child(4) {
    grid-column: 3;
    grid-row: 3;
}

/* Face 5 - coins + centre */
.dice.face-5 .dice-pip:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.dice.face-5 .dice-pip:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
}

.dice.face-5 .dice-pip:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

.dice.face-5 .dice-pip:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
}

.dice.face-5 .dice-pip:nth-child(5) {
    grid-column: 3;
    grid-row: 3;
}

/* Face 6 - deux colonnes */
.dice.face-6 .dice-pip:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.dice.face-6 .dice-pip:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
}

.dice.face-6 .dice-pip:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
}

.dice.face-6 .dice-pip:nth-child(4) {
    grid-column: 3;
    grid-row: 1;
}

.dice.face-6 .dice-pip:nth-child(5) {
    grid-column: 3;
    grid-row: 2;
}

.dice.face-6 .dice-pip:nth-child(6) {
    grid-column: 3;
    grid-row: 3;
}

/* Tirage au sort */
.tirage-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    min-height: 350px;
}

.tirage-wheel-container {
    position: relative;
    width: 320px;
    height: 320px;
}

.tirage-arrow {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-top: 35px solid #e74c3c;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.tirage-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
    position: relative;
    transition: transform 0.1s linear;
    overflow: hidden;
    border: 8px solid #fff;
}

.tirage-wheel svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.tirage-wheel.spinning {
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.tirage-wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border: 4px solid #fff;
}

.tirage-center {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

.tirage-name-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.tirage-name {
    position: absolute;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    line-height: 1;
}

.tirage-winner {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: none;
    animation: slideIn 0.5s ease;
}

.tirage-winner.show {
    display: block;
}

.tirage-winner-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.tirage-winner-name {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Boutons d'action */
.btn-action {
    width: 100%;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

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

.btn-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Messages d'erreur */
.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
    min-height: 24px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Historique des tirages */
.historique-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.historique-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.historique-header h3 {
    color: #667eea;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.btn-clear-history {
    padding: 0.5rem 1rem;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

.btn-clear-history:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.4);
}

.btn-clear-history:active {
    transform: translateY(0);
}

.historique-content {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.historique-content::-webkit-scrollbar {
    width: 8px;
}

.historique-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.historique-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.historique-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.historique-empty {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 2rem;
    margin: 0;
}

.historique-item {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.historique-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.historique-type {
    font-weight: 700;
    color: #667eea;
    font-size: 1rem;
}

.historique-time {
    font-size: 0.85rem;
    color: #999;
}

.historique-result {
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.historique-details {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .generateur-aleatoire-container {
        padding: 1.5rem;
        margin: 1rem;
    }

    .generateur-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .roue-container,
    .des-container,
    .tirage-container {
        padding: 1.5rem;
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .roue-controls,
    .des-controls,
    .tirage-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .tirage-wheel-container {
        width: 280px;
        height: 280px;
    }

    .tirage-wheel-center {
        width: 60px;
        height: 60px;
    }

    .tirage-center {
        font-size: 1.5rem;
    }

    .tirage-name {
        font-size: 0.85rem;
    }

    .tirage-winner-name {
        font-size: 1.5rem;
    }

    .input-group {
        width: 100%;
    }

    .roue-wheel {
        width: 150px;
        height: 150px;
    }

    .roue-number {
        font-size: 2.5rem;
    }

    .dice {
        width: 80px;
        height: 80px;
        padding: 8px;
    }

    .dice-pip {
        width: 14px;
        height: 14px;
    }

    .btn-action {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }

    .historique-section {
        padding: 1rem;
    }

    .historique-header h3 {
        font-size: 1.25rem;
    }

    .btn-clear-history {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .historique-content {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .generateur-aleatoire-container {
        padding: 1rem;
        margin: 0.5rem;
    }

    .roue-wheel {
        width: 120px;
        height: 120px;
    }

    .roue-number {
        font-size: 2rem;
    }

    .dice {
        width: 70px;
        height: 70px;
        padding: 6px;
    }

    .dice-pip {
        width: 12px;
        height: 12px;
    }

    .des-display {
        gap: 1rem;
    }

    .tirage-wheel-container {
        width: 240px;
        height: 240px;
    }

    .tirage-wheel-center {
        width: 50px;
        height: 50px;
    }

    .tirage-center {
        font-size: 1.2rem;
    }

    .tirage-name {
        font-size: 0.7rem;
    }

    .tirage-winner-name {
        font-size: 1.3rem;
    }

    .historique-section {
        padding: 0.75rem;
    }

    .historique-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .historique-header h3 {
        font-size: 1.1rem;
    }

    .btn-clear-history {
        width: 100%;
    }

    .historique-content {
        max-height: 250px;
    }

    .historique-result {
        font-size: 1rem;
    }
}
