/* ===== RESET & VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f3f4f6;
    --white: #ffffff;
    --border: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
}

.hidden { 
    display: none !important; 
}

/* ===== LOGIN SCREEN ===== */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    text-align: center;
}

.logo .lotus {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.tagline {
    color: rgba(255,255,255,0.95);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.dharma-quote {
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    font-style: italic;
    margin-bottom: 40px;
    line-height: 1.6;
}

.dharma-quote span {
    font-size: 0.85rem;
    opacity: 0.8;
}

.btn-login {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.25);
}

/* ===== HEADER ===== */
.header {
    background: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.user-info h3 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 4px;
}

.stats-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.points-badge {
    background: var(--success);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--border);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

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

.section-header h2 {
    font-size: 1.5rem;
    color: white;
}

.today-date {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
}

/* ===== ENTRY SECTION ===== */
.entry-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.diary-textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.diary-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.action-buttons {
    margin-top: 16px;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

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

/* ===== LOADING ===== */
.loading {
    text-align: center;
    padding: 32px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== ANALYSIS RESULT ===== */
.analysis-result {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid var(--border);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
}

.score-value.positive { color: var(--success); }
.score-value.negative { color: var(--danger); }

.breakdown-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg);
    border-radius: 12px;
}

.breakdown-section h4 {
    margin-bottom: 12px;
    color: var(--text);
}

.actions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid;
}

.action-item.good {
    border-left-color: var(--success);
}

.action-item.bad {
    border-left-color: var(--danger);
}

.action-info {
    flex: 1;
}

.action-info strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
}

.action-info p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.action-points {
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
    margin-left: 12px;
}

.action-points.positive { color: var(--success); }
.action-points.negative { color: var(--danger); }

.ai-insight {
    padding: 16px;
    background: linear-gradient(135deg, #e0e7ff, #fce7f3);
    border-radius: 12px;
    margin-bottom: 20px;
}

.ai-insight h4 {
    margin-bottom: 8px;
    color: var(--primary);
}

.btn-save {
    width: 100%;
    padding: 16px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save:hover {
    background: #059669;
}

/* ===== HISTORY ===== */
.history-section {
    margin-bottom: 30px;
}

.summary-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    color: white;
    font-weight: 600;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.history-header:hover {
    background: var(--bg);
}

.history-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.history-score {
    font-weight: 700;
    font-size: 1.1rem;
}

.history-score.positive { color: var(--success); }
.history-score.negative { color: var(--danger); }

.history-detail {
    max-height: 1000px;
    padding: 0 16px 16px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.history-detail.collapsed {
    max-height: 0;
    padding: 0 16px;
}

.diary-excerpt {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
}

.diary-excerpt p {
    margin-top: 8px;
    color: var(--text-light);
    white-space: pre-wrap;
}

.summary-section {
    margin-bottom: 12px;
}

.summary-section strong {
    display: block;
    margin-bottom: 8px;
}

.summary-section p {
    margin: 4px 0;
    padding-left: 12px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

/* ===== RANK SECTION ===== */
.rank-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    position: relative;
    overflow: hidden;
}

.rank-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
}

.rank-section h3 {
    margin-bottom: 16px;
}

/* Current Rank Showcase */
.current-rank-showcase {
    text-align: center;
    margin: 30px 0;
    padding: 40px 20px;
    border-radius: 20px;
    border: 3px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.rank-icon-large {
    font-size: 5rem;
    margin-bottom: 15px;
    display: inline-block;
    animation: floatRank 3s ease-in-out infinite;
}

@keyframes floatRank {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

.rank-name-large {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rank-points-display {
    font-size: 1.5rem;
    color: var(--text);
    font-weight: 600;
}

/* Progress Bar */
.rank-progress {
    margin: 30px 0;
}

.rank-progress h3 {
    margin-bottom: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    height: 30px;
    background: var(--bg);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 1s ease-out;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 15px;
}

.rank-text {
    text-align: center;
    margin-top: 10px;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Streak Display */
.streak-showcase {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.streak-number {
    font-size: 3rem;
    font-weight: 800;
    display: block;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.streak-label {
    font-size: 1.2rem;
    margin-top: 5px;
}

.streak-fire {
    font-size: 2rem;
}

/* ===== RANKS GRID ===== */
.ranks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding-top: 15px;
}

.rank-item {
    position: relative;
    padding: 20px 15px;
    border-radius: 15px !important;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    cursor: pointer;
    border: 2px solid transparent;
}

.rank-item.locked {
    background: linear-gradient(135deg, #e0e0e0, #bdbdbd) !important;
    color: #757575 !important;
    opacity: 0.6;
    border-radius: 15px !important;
}

.rank-item.unlocked {
    color: white !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-radius: 15px !important;
}

.rank-item.unlocked:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.rank-item.current {
    border: 3px solid #FFD700 !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6) !important;
    transform: scale(1.02);
    border-radius: 15px !important;
    animation: currentRankGlow 2s ease-in-out infinite;
}

@keyframes currentRankGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.9); }
}

.current-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.6);
    z-index: 10;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

.mythic-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    z-index: 5;
}

.rank-item-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.rank-item-name {
    display: block;
    font-size: 0.85rem;
    line-height: 1.3;
    margin-bottom: 5px;
}

.rank-item-min {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Legendary Ranks - Special Effects */
.rank-item.legendary {
    animation: legendaryPulse 2s ease-in-out infinite;
    border: 2px solid rgba(255, 215, 0, 0.5);
}

@keyframes legendaryPulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.2);
    }
    50% { 
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.3);
    }
}

.rank-item.mythic {
    animation: mythicShine 3s linear infinite;
    background-size: 200% 200% !important;
}

@keyframes mythicShine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== STATS SECTION ===== */
.stats-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.detailed-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-box {
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s;
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-box.highlight {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat-date {
    font-size: 0.75rem;
    margin-top: 5px;
    opacity: 0.8;
}

/* ===== ACHIEVEMENT POPUP ===== */
.achievement-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    z-index: 2000;
    text-align: center;
    max-width: 400px;
    animation: popupShow 0.5s ease-out forwards;
}

@keyframes popupShow {
    to { transform: translate(-50%, -50%) scale(1); }
}

.achievement-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.achievement-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.achievement-message {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 20px;
    white-space: pre-line;
}

.achievement-close {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.achievement-close:hover {
    transform: scale(1.05);
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px;
    padding: 16px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--success);
    color: white;
}

.notification.info {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .main-content {
        padding: 16px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .diary-textarea {
        min-height: 150px;
        font-size: 0.95rem;
    }
    
    .ranks-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .rank-item {
        padding: 15px 10px;
        border-radius: 12px !important;
    }
    
    .detailed-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rank-icon-large {
        font-size: 3.5rem;
    }
    
    .rank-name-large {
        font-size: 1.5rem;
    }
    
    .current-rank-showcase {
        padding: 30px 15px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}
/* Expand button */
.btn-expand {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}

.btn-expand:hover {
    background: var(--secondary);
}

/* Entry badges */
.entry-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}

.entry-badge.perfect {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.entry-badge.high-score {
    background: linear-gradient(135deg, #00CED1, #4169E1);
    color: white;
}

/* Load more button */
.btn-load-more {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.2);
    border: 2px dashed rgba(255,255,255,0.4);
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load-more:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.6);
}

/* More indicator */
.more-indicator {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.85rem;
}

/* Diary excerpt scrollable */
.diary-excerpt p {
    max-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
}
/* ===== CHART SECTION ===== */
.chart-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.chart-controls {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    justify-content: center;
}

.chart-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: white;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-btn:hover {
    background: var(--bg);
}

.chart-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: var(--primary);
}

.chart-container {
    position: relative;
    height: 300px;
    margin-top: 20px;
}

@media (max-width: 640px) {
    .chart-container {
        height: 250px;
    }
}
/* ===== ACHIEVEMENTS ===== */
.achievements-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.achievements-grid {
    margin-top: 20px;
}

/* Achievements Summary */
.achievements-summary {
    margin-bottom: 25px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 15px;
    color: white;
}

.achievements-progress {
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-text {
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

.progress-bar-mini {
    flex: 1;
    height: 12px;
    background: rgba(255,255,255,0.3);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 6px;
    transition: width 0.5s ease;
}

/* Achievement Categories */
.achievement-category {
    margin-bottom: 25px;
}

.category-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    color: var(--text);
    font-size: 1.1rem;
}

.category-count {
    background: var(--bg);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

/* Achievement Cards */
.achievement-card {
    position: relative;
    padding: 15px 10px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

.achievement-card.locked {
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    opacity: 0.6;
    filter: grayscale(80%);
}

.achievement-card.locked:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.achievement-card.unlocked {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    animation: achievementGlow 3s ease-in-out infinite;
}

@keyframes achievementGlow {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5); }
}

.achievement-card.unlocked:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
}

.achievement-icon-large {
    font-size: 2.5rem;
    margin-bottom: 8px;
    display: block;
}

.achievement-name {
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 4px;
    line-height: 1.2;
}

.achievement-desc {
    font-size: 0.7rem;
    opacity: 0.85;
    line-height: 1.3;
}

.achievement-reward {
    margin-top: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.9;
}

.achievement-unlocked {
    position: absolute;
    top: -8px;
    right: -8px;
    background: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

@media (max-width: 640px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .achievement-card {
        padding: 12px 8px;
    }
    
    .achievement-icon-large {
        font-size: 2rem;
    }
    
    .achievements-progress {
        flex-direction: column;
        gap: 10px;
    }
    
    .progress-bar-mini {
        width: 100%;
    }
}

/* ===== DELETE ENTRY BUTTON ===== */
.entry-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-delete-entry {
    background: transparent;
    color: var(--danger);
    border: 2px solid var(--danger);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete-entry:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.02);
}

/* ===== DATA MANAGEMENT SECTION ===== */
.data-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.data-section h3 {
    margin-bottom: 8px;
}

.data-section-desc {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.data-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.btn-data {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.btn-data .btn-icon-large {
    font-size: 2rem;
}

.btn-data .btn-text {
    display: flex;
    flex-direction: column;
}

.btn-data .btn-text strong {
    font-size: 1rem;
    margin-bottom: 3px;
}

.btn-data .btn-text small {
    font-size: 0.8rem;
    opacity: 0.8;
}

.btn-data.export {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-data.export:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-data.recalc {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.btn-data.recalc:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-data.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-data.danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.data-info {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #92400e;
}

.data-info p {
    margin: 0;
}

@media (max-width: 640px) {
    .data-actions {
        grid-template-columns: 1fr;
    }
    
    .btn-data {
        padding: 15px;
    }
    
    .btn-data .btn-icon-large {
        font-size: 1.5rem;
    }
}

/* ===== FOOTER ===== */
.app-footer {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.footer-quote {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa, #e4e8f0);
    border-radius: 15px;
    border-left: 4px solid var(--primary);
}

.quote-text {
    font-size: 1.1rem;
    color: var(--text);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 10px;
}

.quote-source {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    color: var(--text-light);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .footer-links {
        flex-direction: column;
        gap: 5px;
    }
    
    .footer-links span:nth-child(2) {
        display: none;
    }
}