/* ====================================
   Modal Components
   ==================================== */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    align-items: center;
    z-index: 9999;
}

.modal-overlay.active {
    display: flex;
}

/* Modal Container */
.modal-container {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 0;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-floating);
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-primary);
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-raised);
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    transform: scale(1.1);
    color: var(--color-hover);
    box-shadow: var(--shadow-raised-hover);
}

/* Modal Body */
.modal-body {
    padding: 20px 25px;
    overflow-y: auto;
    flex: 1;
}

.modal-body textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    background: var(--bg-body);
    color: var(--text-primary);
    resize: vertical;
    font-family: inherit;
    margin-top: 10px;
}

/* Modal Stats */
.modal-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: var(--shadow-inset);
}

.modal-progress {
    color: var(--text-accent);
    font-weight: 600;
    font-size: 14px;
}

.modal-valid-count {
    color: var(--color-success);
    font-weight: 600;
    font-size: 14px;
}

.modal-count {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-primary);
}

.modal-btn {
    padding: 10px 20px;
    min-width: 120px;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #E040FB, #9C27B0);
    color: white;
}

/* QR Popup */
#qrPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

#qrPopupBox {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-raised);
    text-align: center;
    border: none;
}

#qrPopupImg {
    width: 300px;
    height: 300px;
    border-radius: 12px;
    border: 4px solid var(--bg-secondary);
    box-shadow: var(--shadow-inset);
    padding: 10px;
    background: white;
}

#qrPopupText {
    color: var(--text-accent);
    margin-top: 25px;
    font-size: 16px;
    font-weight: 700;
    text-shadow: none;
    background: var(--bg-primary);
    padding: 12px 30px;
    border-radius: 50px;
    box-shadow: var(--shadow-inset);
    display: inline-block;
    letter-spacing: 1px;
}