/* Styles pour les composants */

/* Empêcher le débordement horizontal global */
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Canvas starfield */
canvas#starfield {
    background: transparent;
}

/* Hero text shadows */
#hero h1,
#hero h2,
#hero p {
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* Button table styles */
.btn-table {
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 4px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-table:hover {
    background-color: #e2e8f0;
}

/* Dialog modal styles */
dialog[open] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    animation: fadeIn 0.25s ease-out;
    width: 100%;
    max-width: 768px;
    max-height: 95vh;
    margin: 2vh auto;
    overflow: hidden;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    background: white;
}

dialog[open]>div {
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

@media (min-width: 640px) {
    dialog[open] {
        margin: auto;
    }

    dialog[open]>div {
        padding: 1.5rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

body:has(dialog[open]) {
    overflow: hidden;
}

/* Cookie popup styles */
#cookiePopup {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    font-family: Arial, sans-serif;
}

#cookiePopup.active {
    display: flex;
}

#cookiePopup>div {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 36rem;
    width: 90vw;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    color: #2d3748;
}

#cookiePopup h2 {
    font-weight: 600;
    font-size: 1.5rem;
    color: #047857;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#cookiePopup button#closePopup {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #718096;
    font-size: 1.25rem;
}

#cookiePopup form>div {
    margin-bottom: 1rem;
}

#cookiePopup label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

#cookiePopup input[type="checkbox"] {
    cursor: pointer;
}

#cookiePopup p {
    font-size: 0.75rem;
    color: #718096;
    margin-left: 1.5rem;
    margin-top: 0.25rem;
}

#cookiePopup form .actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

#cookiePopup form button {
    cursor: pointer;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border: 1px solid #cbd5e1;
}

#cookiePopup form button:hover {
    background-color: #f3f4f6;
}

#cookiePopup form button#acceptSelected {
    background-color: #047857;
    border-color: #047857;
    color: white;
}

#cookiePopup form button#acceptSelected:hover {
    background-color: #065f46;
    border-color: #065f46;
}

@media (max-width: 640px) {
    #cookiePopup>div {
        width: 95vw;
        padding: 1.25rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    #cookiePopup h2 {
        font-size: 1.25rem;
    }

    #cookiePopup p {
        font-size: 0.7rem;
        margin-left: 1rem;
    }

    #cookiePopup form .actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    #cookiePopup form button {
        width: 100%;
        text-align: center;
    }

    #cookiePopup button#closePopup {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.5rem;
    }
}

/* Scroll animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    animation: fadeUp 0.8s ease-out forwards;
}

/* Modal style */
.modal-style {
    width: 90vw;
    max-width: 450px;
    height: 450px;
    border-radius: 1rem;
    background-color: white;
    border-width: 2px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    position: relative;
}

.modal-style::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
}
