:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #eab308;
    --border-color: #334155;
    --nav-height: 64px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header Re-use/Override */
.app-header {
    height: var(--nav-height);
    padding: 0 1.5rem;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-left: 1rem;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Layout */
.profile-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Stat Card specific */
.stat-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Topics Chart */
.topic-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topic-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.topic-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 500;
}

.topic-stats-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
}

.activity-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.activity-id {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-topic {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.activity-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-weight: 600;
}

.status-correct {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success-color);
}

.status-incorrect {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Heatmap */
.heatmap-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.heatmap-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

.streak-stat {
    text-align: center;
}

.streak-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.streak-lbl {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
}

.level-1 {
    background: rgba(59, 130, 246, 0.2);
}

.level-2 {
    background: rgba(59, 130, 246, 0.4);
}

.level-3 {
    background: rgba(59, 130, 246, 0.6);
}

.level-4 {
    background: rgba(59, 130, 246, 0.8);
}

/* profile-empty-state */
.empty-state {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
}

/* Auth Styles */
.sign-in-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.sign-in-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-large {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name-large {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sign-out-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-left: 0.75rem;
}

.sign-out-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger-color);
}

/* Account Section */
.account-section {
    margin-bottom: 2rem;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.account-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.account-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.account-email-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.account-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-color);
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Guest Notice */
.guest-notice {
    text-align: center;
    padding: 2.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
    border: 1px dashed var(--border-color);
}

.guest-icon {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.guest-notice h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.guest-notice p {
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--accent-color), #2563eb);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Danger Zone */
.danger-zone {
    margin-top: 2rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.03);
}

.danger-title {
    color: var(--danger-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.danger-description {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.danger-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.danger-btn:hover:not(:disabled) {
    background: var(--danger-color);
    color: white;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 1rem 0 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.modal-list {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0 0 1.25rem 1.25rem;
    line-height: 1.8;
}

.modal-warning {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.reset-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
}

.reset-input:focus {
    outline: none;
    border-color: var(--danger-color);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}