/* Badge Styles */
.realist-streak-container {
    position: relative;
    display: inline-block;
}

.realist-streak-widget {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 24px;
    background-color: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 800;
    font-size: 17px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
}

.realist-streak-widget:hover {
    transform: scale(1.05);
}

.realist-streak-widget .realist-flame-icon {
    margin-right: 6px;
    font-size: 20px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Active Badge */
.realist-streak-widget.realist-flame-active {
    background: #fff4e5;
    color: #ff7b00;
    border-color: #ffcc80;
    box-shadow: 0 4px 12px rgba(255, 123, 0, 0.15);
}

.realist-streak-widget.realist-flame-active .realist-flame-icon {
    filter: none;
    opacity: 1;
    animation: realist-flame-burn 1.5s infinite alternate;
}

@keyframes realist-flame-burn {
    0% { transform: scale(1) translateY(0); }
    100% { transform: scale(1.15) translateY(-2px); }
}

/* Modal Overlay */
.realist-streak-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    backdrop-filter: blur(4px);
}

/* Modal Body */
.realist-streak-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #fff;
    width: 340px;
    max-width: 90%;
    border-radius: 20px;
    z-index: 99999;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: realist-modal-pop 0.3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

@keyframes realist-modal-pop {
    100% { transform: translate(-50%, -50%) scale(1); }
}

.realist-streak-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.realist-streak-modal-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.realist-streak-modal-close {
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.realist-streak-modal-close:hover {
    color: #333;
}

.realist-streak-modal-body {
    padding: 25px 20px;
    text-align: center;
}

.realist-modal-big-flame {
    margin-bottom: 25px;
}

.realist-modal-big-flame .realist-flame-icon {
    font-size: 60px;
    line-height: 1;
    display: block;
    margin-bottom: 10px;
}

.realist-modal-big-flame h2 {
    margin: 0;
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
    color: #333;
}

.realist-modal-big-flame.realist-flame-active h2 {
    color: #ff7b00;
}

.realist-modal-big-flame p {
    margin: 5px 0 0;
    font-weight: 600;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px;
}

.realist-weekly-checkin {
    display: flex;
    justify-content: space-between;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 15px;
}

.realist-day-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.realist-day-label {
    font-size: 12px;
    font-weight: 700;
    color: #aaa;
    margin-bottom: 8px;
}

.realist-day-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: transparent;
    transition: all 0.3s ease;
}

.realist-day-completed .realist-day-label {
    color: #ff7b00;
}

.realist-day-completed .realist-day-circle {
    background: #ff7b00;
    color: #fff;
    box-shadow: 0 4px 8px rgba(255, 123, 0, 0.3);
}

.realist-day-future .realist-day-circle {
    background: transparent;
    border: 2px dashed #ddd;
}

.realist-day-today .realist-day-circle {
    border: 2px solid #ff7b00;
    box-shadow: 0 0 0 4px rgba(255, 123, 0, 0.1);
}

.realist-modal-tip {
    font-size: 13px;
    color: #666;
    margin: 0 0 15px 0;
}

.realist-leaderboard-link {
    display: inline-block;
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.realist-leaderboard-link:hover {
    color: #004499;
    text-decoration: underline;
}

/* Gamification Store Styles */
.realist-gamification-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Gamification Dashboard (2 Columns) */
.realist-gamification-dashboard {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (max-width: 768px) {
    .realist-gamification-dashboard {
        grid-template-columns: 1fr;
    }
}

.realist-dashboard-main {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.realist-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.realist-dashboard-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.realist-gems-balance {
    display: inline-flex;
    align-items: center;
    background: #f0f8ff;
    padding: 6px 14px;
    border-radius: 20px;
    color: #0073e6;
    font-weight: bold;
}

.realist-gem-icon { margin-right: 6px; display: flex; align-items: center; }
.realist-gem-count { font-size: 18px; margin-right: 4px; }

/* Dashboard Sidebar */
.realist-dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.realist-sidebar-box {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.realist-sidebar-box h4 {
    margin-top: 0;
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Ways to earn */
.realist-ways-to-earn ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.realist-ways-to-earn li {
    display: flex;
    align-items: center;
    background: #fafafa;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #eee;
}
.realist-ways-to-earn .guide-icon {
    margin-right: 10px;
    font-size: 18px;
    display: flex;
    align-items: center;
    color: #0073e6;
}
.realist-ways-to-earn .guide-label {
    flex-grow: 1;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}
.realist-ways-to-earn .guide-val {
    font-weight: 600;
    color: #00b341;
    font-size: 13px;
}

/* Store Cards */
.realist-store-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.realist-store-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    background: #fff;
    border-color: #e0e0e0;
}

.realist-card-icon {
    font-size: 32px;
    margin-right: 20px;
    background: #eef5fc;
    color: #0073e6;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.realist-card-content { flex: 1; }
.realist-card-content h4 { margin: 0 0 6px 0; font-size: 16px; color: #333; }
.realist-card-content p { margin: 0 0 10px 0; font-size: 13px; color: #666; line-height: 1.4; }

.realist-item-status {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}
.realist-item-status svg { margin-right: 4px; }
.realist-status-protected {
    background: #e6f9ed;
    color: #00b341;
}
.realist-status-unprotected {
    background: #fff0ed;
    color: #e63946;
}

.realist-card-action {
    margin-left: 20px;
}

.realist-buy-btn {
    background: #fff;
    color: #0073e6;
    border: 1px solid #0073e6;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.realist-buy-btn:hover {
    background: #0073e6;
    color: #fff;
}

.realist-btn-disabled {
    background: #f5f5f5;
    color: #aaa;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: not-allowed;
}

/* History Scrollbox */
.realist-history-scroll {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}
.realist-history-scroll::-webkit-scrollbar {
    width: 4px;
}
.realist-history-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.realist-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.realist-history-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
}

.realist-history-list li:last-child {
    border-bottom: none;
}

.realist-history-info {
    display: flex;
    flex-direction: column;
}

.realist-history-desc {
    font-size: 13px;
    color: #444;
    font-weight: 500;
}

.realist-history-date {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.realist-history-amount {
    font-weight: bold;
    font-size: 14px;
}

.realist-gem-earn { color: #00b341; }
.realist-gem-spend { color: #e63946; }

/* Leaderboard Styles */
.realist-leaderboard-wrapper {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 800px;
    margin: 0 auto;
}

.realist-leaderboard-header {
    text-align: center;
    margin-bottom: 30px;
}

.realist-trophy-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.realist-leaderboard-header h3 {
    margin: 0 0 8px 0;
    font-size: 28px;
    color: #222;
}

.realist-leaderboard-header p {
    color: #666;
    margin: 0;
}

.realist-leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.realist-leaderboard-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #fafafa;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: transform 0.2s;
    border: 1px solid transparent;
}

.realist-leaderboard-item:hover {
    transform: scale(1.02);
    background: #fff;
    border-color: #eee;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.realist-rank-top.realist-rank-1 {
    background: #fff9e6;
    border-color: #ffd700;
}

.realist-rank-top.realist-rank-1 .realist-rank-badge { background: #ffd700; color: #b8860b; }

.realist-rank-top.realist-rank-2 {
    background: #f5f5f5;
    border-color: #c0c0c0;
}

.realist-rank-top.realist-rank-2 .realist-rank-badge { background: #c0c0c0; color: #696969; }

.realist-rank-top.realist-rank-3 {
    background: #fff0e6;
    border-color: #cd7f32;
}

.realist-rank-top.realist-rank-3 .realist-rank-badge { background: #cd7f32; color: #8b4513; }

.realist-rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #eee;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 20px;
}

.realist-student-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.realist-student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.realist-student-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.realist-student-streak {
    display: flex;
    align-items: center;
    background: #fff4e5;
    padding: 6px 12px;
    border-radius: 20px;
    color: #ff7b00;
}

.realist-student-streak strong {
    font-size: 18px;
    margin: 0 4px;
}

.realist-student-streak .realist-days-label {
    font-size: 12px;
    font-weight: 500;
}

/* Viral Share Styles */
.realist-btn-share {
    margin-top: 15px;
    width: 100%;
    padding: 12px;
    background: #0073e6;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0, 119, 181, 0.2);
}

.realist-btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 119, 181, 0.3);
}

/* The hidden share card - Rendered far off-screen so user doesn't see it but html2canvas can capture it */
.realist-share-card-hidden {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 1080px;
    height: 1080px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.realist-share-card-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 40px;
    padding: 40px;
    text-align: center;
    width: 800px;
    height: 800px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

.realist-share-logo {
    color: #fff;
    font-size: 36px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 4px;
    opacity: 0.8;
}

.realist-share-flame {
    font-size: 140px;
    line-height: 1;
    margin: 0;
    filter: drop-shadow(0 20px 30px rgba(255, 123, 0, 0.4));
}

.realist-share-flame.realist-flame-active {
    /* No grayscale for active flame */
}

.realist-share-number {
    font-size: 130px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    text-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.realist-share-label {
    font-size: 40px;
    color: #ffd700;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

.realist-share-footer {
    font-size: 32px;
    color: #fff;
    opacity: 0.9;
    font-weight: 500;
    background: rgba(0,0,0,0.2);
    padding: 20px 40px;
    border-radius: 50px;
    display: inline-block;
    align-self: center;
    margin: 0;
}

/* Toast Notifications */
.realist-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 999999;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.realist-toast.show {
    bottom: 30px;
}

.realist-toast-success {
    background: #00c853;
}

.realist-toast-error {
    background: #ff3d00;
}

/* Purchase Modal */
.realist-buy-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
}

.realist-buy-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 400px;
    z-index: 100000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-align: center;
}

.realist-close-buy-modal {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.realist-close-buy-modal:hover {
    color: #333;
}

.realist-buy-modal h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: #333;
}

.realist-buy-modal p {
    color: #666;
    margin: 0 0 20px 0;
}

.realist-qty-selector {
    display: inline-flex;
    align-items: center;
    border: 2px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 25px;
}

.realist-qty-btn {
    background: #f8f8f8;
    border: none;
    padding: 10px 20px;
    font-size: 20px;
    cursor: pointer;
    color: #555;
    font-weight: bold;
}

.realist-qty-btn:hover {
    background: #eee;
}

.realist-qty-selector input {
    width: 60px;
    text-align: center;
    border: none;
    border-left: 2px solid #eee;
    border-right: 2px solid #eee;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    padding: 10px 0;
    outline: none;
}

.realist-buy-summary {
    background: #fafafa;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: left;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.total-row {
    border-top: 1px dashed #ddd;
    padding-top: 10px;
    margin-top: 10px;
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

.realist-confirm-buy-btn {
    width: 100%;
    background: #0073e6;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.realist-confirm-buy-btn:hover {
    background: #005bb5;
}

.realist-confirm-buy-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}
