/* assets/css/generators/dice-roller.css */

.dice-roller-page {
    padding: 2rem 0;
}

.generator-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Main Generator Section (LEFT - Results Area) */
.generator-main {
    background: white;
    border-radius: var(--border-radius, 8px);
    padding: 3rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

/* Dice Display */
.dice-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    margin-bottom: 2rem;
}

/* Initial State */
.initial-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem;
}

.initial-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
    opacity: 0.3;
    color: var(--primary-color, #4A90E2);
}

.initial-icon svg {
    width: 100%;
    height: 100%;
}

.initial-text {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.initial-help {
    color: #666;
    font-size: 1.1rem;
}

/* Dice Container */
.dice-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.die {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.die.rolling {
    animation: diceRoll 0.1s linear infinite;
}

.die.final {
    animation: diceReveal 0.5s ease-out;
}

@keyframes diceRoll {
    0%, 100% {
        transform: rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: rotateX(180deg) rotateY(0deg);
    }
    50% {
        transform: rotateX(180deg) rotateY(180deg);
    }
    75% {
        transform: rotateX(0deg) rotateY(180deg);
    }
}

@keyframes diceReveal {
    0% {
        transform: scale(0.8) rotateY(180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotateY(0);
        opacity: 1;
    }
}

/* Results Section */
.results-section {
    margin-top: 2rem;
    animation: fadeIn 0.3s ease-in-out;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: var(--border-radius, 8px);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-icon:hover {
    border-color: var(--primary-color, #4A90E2);
    background: rgba(74, 144, 226, 0.05);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Roll Result */
.roll-result {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-formula {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.result-rolls,
.result-modifier,
.result-total {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.result-rolls .label,
.result-modifier .label,
.result-total .label {
    font-weight: 600;
    color: #495057;
}

.roll-values {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.roll-value {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 0.25rem 0.75rem;
    font-weight: 600;
    color: #495057;
}

.modifier-value {
    font-weight: 700;
    color: #495057;
}

.result-total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #dee2e6;
    font-size: 1.5rem;
}

.total-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color, #4A90E2);
}

/* History Section */
.history-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.btn-text {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.btn-text:hover {
    color: #c82333;
    text-decoration: underline;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.no-history {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-style: italic;
}

.history-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: translateX(4px);
}

.history-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.history-formula {
    font-weight: 700;
    color: #333;
    font-size: 1rem;
}

.history-result {
    color: var(--primary-color, #4A90E2);
    font-weight: 700;
    font-size: 1.1rem;
}

.history-time {
    color: #6c757d;
    font-size: 0.85rem;
    margin-left: auto;
}

.history-rolls {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Settings Panel (RIGHT) */
.settings-panel {
    background: white;
    border-radius: var(--border-radius, 8px);
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary-color, #4A90E2);
}

.tab-btn.active {
    color: var(--primary-color, #4A90E2);
    border-bottom-color: var(--primary-color, #4A90E2);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius, 8px);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #4A90E2);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #666;
}

/* Dice Type Grid */
.dice-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.dice-btn {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: var(--border-radius, 8px);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dice-btn:hover {
    border-color: var(--primary-color, #4A90E2);
    background: rgba(74, 144, 226, 0.05);
}

.dice-btn.active {
    background: var(--primary-color, #4A90E2);
    border-color: var(--primary-color, #4A90E2);
    color: white;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 500;
}

/* Roll Button */
.btn-primary {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius, 8px);
    background: linear-gradient(135deg, var(--primary-color, #4A90E2), var(--secondary-color, #357ABD));
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary svg {
    width: 24px;
    height: 24px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Info Section */
.info-section {
    background: white;
    border-radius: var(--border-radius, 8px);
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.info-grid {
    display: grid;
    gap: 2rem;
}

.info-block h2,
.info-block h3 {
    color: #333;
    margin-top: 0;
}

.info-block p {
    color: #666;
    line-height: 1.6;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    margin-bottom: 1.5rem;
}

.info-list strong {
    display: block;
    color: #333;
    margin-bottom: 0.25rem;
}

.info-list p {
    margin: 0;
    color: #666;
}

.feature-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.feature-list li {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: var(--border-radius, 8px);
    border-left: 4px solid var(--primary-color, #4A90E2);
    color: #495057;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .generator-content {
        grid-template-columns: 1fr;
    }

    .dice-container {
        gap: 1rem;
    }

    .die {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .dice-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-list {
        grid-template-columns: 1fr;
    }

    .result-formula {
        font-size: 1.5rem;
    }

    .result-total {
        font-size: 1.25rem;
    }

    .total-value {
        font-size: 1.75rem;
    }
}
