/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-surface);
    width: 90%;
    max-width: 420px;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    border: 1px solid rgba(var(--color-primary-rgb), 0.08);
    overflow: hidden;
}

[data-theme="dark"] .modal-content {
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.06);
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--color-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-body);
    opacity: 0.5;
    padding: 0.25rem;
    border-radius: 8px;
    transition: opacity 0.2s, background 0.2s;
}

.close-modal:hover {
    opacity: 1;
    background: rgba(var(--color-primary-rgb), 0.08);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* Sessions */
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.session-item {
    padding: 0.85rem 1rem;
    background: rgba(var(--color-primary-rgb), 0.03);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s;
}

.session-item:hover {
    background: rgba(var(--color-primary-rgb), 0.06);
}

.session-item.active {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.08);
}

.session-name {
    font-weight: 500;
}

.session-count {
    color: var(--color-primary);
    font-weight: 700;
}

.delete-session {
    color: #e74c3c;
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

.new-session-form {
    display: flex;
    gap: 0.5rem;
}

.new-session-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.25rem;
    background: var(--bg-body);
    color: var(--text-body);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s, transform 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Button with Icon */
.btn-with-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Stats */
.stats-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(var(--color-primary-rgb), 0.04);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(var(--color-primary-rgb), 0.06);
}

[data-theme="dark"] .stat-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.6;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.simple-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 150px;
    padding-top: 20px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, var(--color-primary), rgba(var(--color-primary-rgb), 0.6));
    opacity: 0.65;
    border-radius: 6px 6px 2px 2px;
    position: relative;
    transition: height 0.3s, opacity 0.3s;
    min-height: 4px;
}

.chart-bar:hover {
    opacity: 1;
}

.chart-bar-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.6;
    font-size: 0.7rem;
    white-space: nowrap;
}

/* Confirmation Modal */
.confirmation-content {
    max-width: 300px;
    padding: 1.5rem;
    text-align: center;
}

.confirmation-message {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-body);
}

.confirmation-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-secondary {
    background: transparent;
    color: var(--text-body);
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background 0.2s;
}

[data-theme="dark"] .btn-secondary {
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Animation */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Theme Modal Grid */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-surface);
    padding: 1.2rem 1rem;
    border-radius: 14px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.theme-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.theme-option.active {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.06);
}

[data-theme="dark"] .theme-option {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.theme-preview {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-bottom: 0.6rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.theme-option:hover .theme-preview {
    transform: scale(1.1);
}

.theme-name {
    font-size: 0.85rem;
    font-weight: 600;
}