/* modals.css - Modal and popup styles */

/* Modal Container */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Content */
.modal-content {
    position: relative;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2.5rem;
    animation: slideIn 0.3s ease, scaleIn 0.3s ease;
}

/* Close Button */
.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 10;
}

.close-button:hover {
    color: var(--text-primary);
}

/* Roll Result Display */
.roll-result-display {
    text-align: center;
}

.roll-result-display h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--accent-gold);
}

/* Dice Visual */
.dice-visual {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.die-icon {
    width: 60px;
    height: 60px;
    background: var(--glass-bg);
    border: 2px solid var(--accent-blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-blue);
    box-shadow: 0 0 15px var(--accent-blue);
    animation: diceRoll 0.5s ease;
}

.die-icon.dropped {
    opacity: 0.5;
    border-color: var(--text-secondary);
    color: var(--text-secondary);
    box-shadow: none;
    text-decoration: line-through;
}

/* Roll Details */
.roll-details {
    margin: 2rem 0;
}

.roll-breakdown {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.roll-total {
    font-size: 3rem;
    color: var(--accent-gold);
    text-shadow: 0 0 20px var(--accent-gold);
    margin: 1rem 0;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Reroll Button */
.reroll-button {
    flex: 1;
    max-width: 200px;
}

/* Confirm Button */
.confirm-button {
    flex: 1;
    max-width: 200px;
}

/* Dropdown Menu */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 60px;
    right: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    min-width: 200px;
    z-index: 100;
}

.dropdown-menu.show {
    display: block;
    animation: dropIn 0.2s ease;
}

.dropdown-menu a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s ease;
}

.dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-menu hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid var(--glass-border);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes scaleIn {
    from {
        transform: scale(0.8);
    }
    to {
        transform: scale(1);
    }
}

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

@keyframes diceRoll {
    0% {
        transform: rotate(0deg) scale(0);
    }
    50% {
        transform: rotate(360deg) scale(1.2);
    }
    100% {
        transform: rotate(720deg) scale(1);
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    z-index: 2000;
    animation: slideUp 0.3s ease;
}

.toast.success {
    border-color: #4caf50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
}

.toast.error {
    border-color: #f44336;
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.4);
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}
