/* main.css - Core Application Styles */

/* Container Layouts */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 100vh;
    padding: 0 1rem;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Headers */
.main-header, .main-footer {
    text-align: center;
    padding: 2rem 1rem;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.8rem;
    margin: 0;
}

.back-button, .menu-button {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: background 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-button:hover, .menu-button:hover {
    background: var(--glass-bg);
}

/* Role Selection */
.role-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem 0;
}

.role-selection h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

/* Dice Roller Main */
.dice-roller-main {
    flex: 1;
    padding: 2rem 1.5rem;
    overflow-y: auto;
}

/* Quick Rolls Section */
.quick-rolls-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.quick-rolls-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.quick-rolls-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-roll-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    min-width: 80px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-roll-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
}

.player-theme .quick-roll-btn:hover {
    border-color: var(--player-red);
    box-shadow: 0 4px 15px var(--player-red-glow);
}

.quick-roll-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 5px currentColor);
}

.quick-roll-label {
    font-size: 0.9rem;
    font-weight: 500;
}

/* DM Theme Quick Rolls */
.dm-theme .quick-roll-btn:hover {
    border-color: var(--dm-purple);
    box-shadow: 0 4px 15px var(--dm-purple-glow);
}

.dm-quick-rolls {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.1), rgba(157, 78, 221, 0.05));
    border-color: var(--dm-purple);
}

.dm-quick-rolls h3 {
    color: var(--dm-purple);
    text-shadow: 0 0 10px var(--dm-purple-glow);
}

/* Dice Rows */
.dice-rows-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dice-row {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s ease;
}

.dice-row:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Player Theme */
.player-theme .dice-row:hover {
    border-color: var(--player-red);
    box-shadow: 0 0 20px var(--player-red-glow);
}

/* DM Theme */
.dm-theme .dice-row:hover {
    border-color: var(--dm-purple);
    box-shadow: 0 0 20px var(--dm-purple-glow);
}

/* Dice Row Header */
.dice-row-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.dice-label-input {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 500;
}

.delete-row-btn {
    background: none;
    border: none;
    color: #f44336;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.delete-row-btn:hover {
    opacity: 1;
}

/* Dice Selection */
.dice-selection {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.dice-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dice-count-input {
    width: 60px;
}

.modifier-input {
    width: 80px;
}

/* Roll Options */
.roll-options {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.roll-type-select {
    min-width: 150px;
}

/* Advanced Options */
.advanced-options {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.drop-input {
    width: 50px;
}

/* Roll Button */
.roll-button {
    align-self: flex-end;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

.player-theme .roll-button {
    background: var(--player-red);
    box-shadow: 0 0 15px var(--player-red-glow);
}

.dm-theme .roll-button {
    background: var(--dm-purple);
    box-shadow: 0 0 15px var(--dm-purple-glow);
}

/* Add Row Button */
.add-row-button {
    width: 100%;
    justify-content: center;
    background: transparent;
    border: 2px dashed var(--glass-border);
    color: var(--text-secondary);
    box-shadow: none;
}

.add-row-button:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
    background: var(--glass-bg);
}

/* Roll History */
.roll-history {
    margin: 2rem 1.5rem;
    padding: 1.5rem;
}

.roll-history h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.history-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.clear-history-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-history-btn:hover {
    border-color: #f44336;
    color: #f44336;
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.history-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--glass-border);
    transition: all 0.2s ease;
}

.history-item:hover {
    background: rgba(0, 0, 0, 0.3);
}

.history-item.player {
    border-left-color: var(--player-red);
}

.history-item.dm {
    border-left-color: var(--dm-purple);
}

.history-label {
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.history-result {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.history-timestamp {
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 0.3rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--glass-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive Design */

/* App Download Section */
.app-downloads {
    margin: 4rem auto;
    text-align: center;
    padding: 2rem;
}

.app-downloads h2 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.app-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.app-store-buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.app-store-link {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.app-store-link:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}


@media (max-width: 600px) {
    .app-store-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
}

/* App Store Badge Styling */
.store-badge {
    height: 40px;
    width: auto;
    vertical-align: middle;
}

/* Specific adjustments to make badges appear same size */
.app-store-link:first-child .store-badge {
    /* Google Play badge */
    height: 48px;
}

.app-store-link:last-child .store-badge {
    /* App Store badge */
    height: 40px;
}

@media (max-width: 600px) {
    .app-store-link:first-child .store-badge {
        height: 40px;
    }
    
    .app-store-link:last-child .store-badge {
        height: 34px;
    }
}
