/* Dice roller styles: floating controls, dice roller modal, roll results/history, inline dice buttons, and toast notifications. */

/* Dice Roller Styles */
.dice-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    z-index: 999;
}

.dice-toggle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    border: 2px solid #ddd;
    font-size: 1.3em;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s;
    opacity: 0.7;
}

.dice-toggle:hover {
    transform: scale(1.05);
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.dice-toggle.active {
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    color: white;
    border-color: var(--accent-color);
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transform: scale(1.1);
}

.dice-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    font-size: 2em;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.dice-fab:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.dice-roller-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

.dice-roller-modal.active {
    display: flex;
}

.dice-roller-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.dice-roller-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.dice-roller-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.dice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.dice-button {
    padding: 15px;
    border: 2px solid var(--primary-color);
    background: white;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
}

.dice-button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.dice-button:active {
    transform: translateY(0);
}

.modifier-section {
    margin-bottom: 20px;
}

.modifier-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.modifier-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
}

.skill-quick-roll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.skill-roll-btn {
    padding: 10px;
    border: 2px solid var(--accent-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.skill-roll-btn:hover {
    background: var(--accent-color);
    color: white;
}

.skill-roll-name {
    font-weight: bold;
    font-size: 0.9em;
}

.skill-roll-modifier {
    font-size: 1.1em;
    color: var(--success-color);
}

.roll-result {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.roll-result-total {
    font-size: 3em;
    font-weight: bold;
    margin: 10px 0;
}

.roll-result-breakdown {
    font-size: 1em;
    opacity: 0.9;
}

.roll-history {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
}

.roll-history-item {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9em;
}

.roll-history-item:last-child {
    border-bottom: none;
}

.roll-history-item strong {
    color: var(--primary-color);
}

.plot-die-section {
    background: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid var(--primary-color);
}

.plot-die-result {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.plot-die-icon {
    font-size: 2em;
}

/* Inline Dice Roller Icons */
.inline-dice-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 8px;
    transition: all 0.2s;
    opacity: 0.7;
    vertical-align: middle;
}

.inline-dice-btn:hover {
    opacity: 1;
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.inline-dice-btn:active {
    transform: scale(0.95);
}

.inline-dice-btn.large {
    width: 32px;
    height: 32px;
    font-size: 1.1em;
}

.defense-row .inline-dice-btn,
.resource-box .inline-dice-btn {
    margin-left: 10px;
}

.skill-row .inline-dice-btn {
    margin-left: 5px;
}

.attribute-box .inline-dice-btn {
    margin-left: 10px;
}

/* Toast notification for quick rolls */
.roll-toast {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
}

.roll-toast.show {
    display: flex;
}

.roll-toast-content {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    min-width: 300px;
    max-width: 500px;
    animation: slideDown 0.3s ease;
}

.roll-toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    font-size: 1.5em;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background 0.2s;
}

.roll-toast-close:hover {
    background: rgba(255, 255, 255, 0.5);
}

.roll-toast-title {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
    padding-right: 30px;
}

.roll-toast-result {
    font-size: 2em;
    font-weight: bold;
    margin: 10px 0;
}

.roll-toast-breakdown {
    font-size: 0.9em;
    opacity: 0.9;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.roll-toast.hiding .roll-toast-content {
    animation: slideOut 0.3s ease;
}

.roll-toast.hiding {
    animation: slideOut 0.3s ease;
}
