/* ================================================
   Graphica — Modal / Popup Global
   ================================================
   Uso:
     Trigger: cualquier elemento con data-modal="id-del-modal"
     Modal:   <div class="grph-modal" id="...">
                <div class="grph-modal__overlay"></div>
                <div class="grph-modal__card">
                  <button class="grph-modal__close">×</button>
                  ...contenido...
                </div>
              </div>
================================================ */

@keyframes grph-modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes grph-modal-fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes grph-modal-slide-up {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes grph-modal-slide-down {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(40px); }
}

.grph-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.grph-modal.is-open {
    display: flex;
}

.grph-modal.is-open .grph-modal__overlay {
    animation: grph-modal-fade-in 0.3s ease forwards;
}

.grph-modal.is-open .grph-modal__card {
    animation: grph-modal-slide-up 0.3s ease forwards;
}

.grph-modal.is-closing .grph-modal__overlay {
    animation: grph-modal-fade-out 0.3s ease forwards;
}

.grph-modal.is-closing .grph-modal__card {
    animation: grph-modal-slide-down 0.3s ease forwards;
}

.grph-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.grph-modal__card {
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 48px 30px 40px;
    max-width: 420px;
    width: 100%;
    z-index: 1;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.grph-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 4px 8px;
}

.grph-modal__close:hover {
    color: #333;
}
