/* Virtual Dice Roller - Styles */

.dice-controls {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

[data-bs-theme="dark"] .dice-controls {
    background: #2d3239;
}

.control-group {
    margin-bottom: 15px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    margin-bottom: 8px;
    display: block;
}

[data-bs-theme="dark"] .control-label {
    color: #e9ecef;
}

.dice-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dice-btn {
    flex: 1;
    min-width: 60px;
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

.dice-btn:hover {
    border-color: #052c65;
    background: #e7f1ff;
}

.dice-btn.active {
    border-color: #052c65;
    background: #052c65;
    color: white;
}

[data-bs-theme="dark"] .dice-btn {
    background: #1a1d21;
    border-color: #495057;
    color: #e9ecef;
}

[data-bs-theme="dark"] .dice-btn:hover {
    background: #2d3239;
    border-color: #052c65;
}

[data-bs-theme="dark"] .dice-btn.active {
    background: #052c65;
    color: white;
}

/* Dice Container */
.dice-display-area {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
    gap: 15px;
    flex-wrap: wrap;
    padding: 20px;
}

.dice-container {
    perspective: 1000px;
    width: 80px;
    height: 80px;
}

.dice {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease-out;
}

/* Idle state animation */
.dice.idle {
    animation: gentle-float 3s ease-in-out infinite;
}

@keyframes gentle-float {
    0%, 100% {
        transform: translateY(0) rotateX(10deg) rotateY(10deg);
    }
    50% {
        transform: translateY(-8px) rotateX(-5deg) rotateY(-5deg);
    }
}

/* Rolling animation */
.dice.rolling {
    animation: dice-roll 0.8s ease-out forwards;
}

@keyframes dice-roll {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    100% {
        transform: rotateX(720deg) rotateY(720deg) rotateZ(360deg);
    }
}

/* Dice Face */
.dice-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    border: 3px solid #d4d4d4;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 900;
    color: #1a1a1a;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 0.5);
    backface-visibility: hidden;
}

[data-bs-theme="dark"] .dice-face {
    background: linear-gradient(135deg, #2d3239, #1a1d21);
    border-color: #495057;
    color: #e9ecef;
}

/* Dots on dice */
.dice-dots {
    display: grid;
    width: 70%;
    height: 70%;
    gap: 6px;
}

.dice-dots.dots-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.dice-dots.dots-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

.dice-dots.dots-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.dice-dots.dots-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.dice-dots.dots-5 {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
}

.dice-dots.dots-6 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    background: #1a1a1a;
    border-radius: 50%;
    box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .dot {
    background: #e9ecef;
}

/* Special positioning for dots */
.dice-dots.dots-1 .dot {
    grid-column: 1;
    grid-row: 1;
    margin: auto;
}

.dice-dots.dots-3 .dot:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.dice-dots.dots-3 .dot:nth-child(2) {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    margin: auto;
}

.dice-dots.dots-3 .dot:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    margin-left: auto;
}

.dice-dots.dots-5 .dot:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.dice-dots.dots-5 .dot:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
}

.dice-dots.dots-5 .dot:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

.dice-dots.dots-5 .dot:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
}

.dice-dots.dots-5 .dot:nth-child(5) {
    grid-column: 3;
    grid-row: 3;
}

/* 6 dots - arranged in 2 columns x 3 rows, centered */
.dice-dots.dots-6 .dot {
    margin: auto;
}

/* Result Display */
.result-display {
    background: linear-gradient(135deg, #052c65, #041f47);
    color: white;
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 8px 24px rgba(5, 44, 101, 0.3);
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.result-display.show {
    opacity: 1;
    transform: scale(1);
}

.result-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.result-value {
    font-size: 48px;
    font-weight: 900;
    font-family: 'Courier New', monospace;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.result-breakdown {
    font-size: 14px;
    margin-top: 8px;
    opacity: 0.9;
}

/* Stats Cards */
.stat-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .stat-card {
    background: #2d3239;
    border-color: #495057;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-subtitle {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

[data-bs-theme="dark"] .stat-label,
[data-bs-theme="dark"] .stat-subtitle {
    color: #adb5bd;
}

/* Primary color for stats in dark mode */
[data-bs-theme="dark"] .stat-value[style*="#052c65"] {
    color: #4a90e2 !important;
}

/* History Table */
.history-table {
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.history-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.history-table th,
.history-table td {
    padding: 14px;
    text-align: center;
}

.history-table th {
    background: #f1f3f5;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
}

[data-bs-theme="dark"] .history-table th {
    background: #2d3239;
    color: #e9ecef;
    border-bottom-color: #495057;
}

.history-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s ease;
}

.history-table tbody tr:hover {
    background: #f8f9fa;
}

[data-bs-theme="dark"] .history-table tbody tr {
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] .history-table tbody tr:hover {
    background: #343a40;
}

.roll-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    background: linear-gradient(135deg, #052c65, #041f47);
    color: white;
    box-shadow: 0 2px 8px rgba(5, 44, 101, 0.25);
}

.dice-values {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #6c757d;
}

[data-bs-theme="dark"] .dice-values {
    color: #adb5bd;
}

/* Result Announcement */
.result-announcement {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #052c65, #041f47);
    color: white;
    padding: 35px 70px;
    border-radius: 25px;
    font-size: 52px;
    font-weight: 800;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    animation: show-result 2.5s ease-in-out;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    border: 3px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 3px;
}

@keyframes show-result {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3) rotate(-15deg);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15) rotate(8deg);
    }
    40% {
        transform: translate(-50%, -50%) scale(0.95) rotate(-4deg);
    }
    60% {
        transform: translate(-50%, -50%) scale(1.05) rotate(2deg);
    }
    75% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7) rotate(0deg);
    }
}

/* Button states */
.toolBtn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.toolBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dice-container {
        width: 65px;
        height: 65px;
    }
    
    .dice-face {
        font-size: 28px;
    }
    
    .result-value {
        font-size: 38px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .result-announcement {
        font-size: 38px;
        padding: 25px 50px;
    }
}

@media (max-width: 480px) {
    .dice-container {
        width: 55px;
        height: 55px;
    }
    
    .dice-face {
        font-size: 24px;
        border-width: 2px;
        border-radius: 8px;
    }
    
    .dice-btn {
        min-width: 50px;
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .result-value {
        font-size: 32px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .result-announcement {
        font-size: 32px;
        padding: 20px 40px;
    }
}