/* ========== BASE STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
    padding: 0;
    display: flex;
    flex-direction: column;
}

main.app {
    width: 100vw;
    flex: 1;
    position: relative;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    padding-top: calc(50px + env(safe-area-inset-top));
}

/* ========== ACCESSIBILITY ========== */
/* Screen reader only content */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip links - Enhanced styling */
.skip-link,
.skip-to-categories,
.skip-to-filters {
    position: fixed;
    top: -100px;
    background: rgba(100, 200, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #000;
    padding: 12px 20px;
    text-decoration: none;
    z-index: 9999;
    font-weight: 500;
    font-size: 14px;
    border-radius: 0 0 12px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0;
    pointer-events: none;
}

.skip-to-categories {
    left: 140px;
    border-radius: 0 0 8px 8px;
}

.skip-to-filters {
    left: 300px;
    border-radius: 0 0 8px 8px;
}

.skip-link:focus,
.skip-to-categories:focus,
.skip-to-filters:focus {
    top: 0;
    outline: 3px solid #fff;
    outline-offset: -3px;
    opacity: 1;
    pointer-events: auto;
}

/* Focus visible styles for better keyboard navigation */
*:focus-visible {
    outline: 3px solid #64c8ff;
    outline-offset: 2px;
}

/* Ensure interactive elements have minimum size for touch/pointer */
button,
a,
select,
.action-btn,
.category-option,
.sort-option {
    min-height: 44px;
    min-width: 44px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .story-card {
        border: 2px solid #fff;
    }
    
    .action-btn {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .story-card {
        transition: none !important;
    }
}

.seo-content {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ========== HEADER STYLES ========== */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(50px + env(safe-area-inset-top));
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top);
    z-index: 110;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-logo {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    text-decoration: none;
    position: relative;
}

.app-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.app-logo:active {
    transform: scale(0.95);
}

.app-logo svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* Subtle glow effect on hover */
.app-logo:hover svg rect {
    fill: #1a1a1a;
}

.app-logo:hover svg path,
.app-logo:hover svg circle {
    filter: drop-shadow(0 0 2px rgba(100, 200, 255, 0.5));
}

/* Subtle animation for the logo wave */
.app-logo svg path:first-of-type {
    animation: logoWave 8s ease-in-out infinite;
}

@keyframes logoWave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.current-filters {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

.filter-label {
    font-size: 10px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-value {
    font-size: 13px;
    font-weight: 600;
    color: #64c8ff;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.filter-value:hover {
    background: rgba(100, 200, 255, 0.1);
}

.filter-value.filtered {
    background: rgba(100, 200, 255, 0.15);
    border: 1px solid rgba(100, 200, 255, 0.3);
}

/* Enhanced current mode styling */
#currentMode {
    background: rgba(100, 200, 255, 0.1);
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid rgba(100, 200, 255, 0.2);
    transition: all 0.2s;
}

#currentMode:hover {
    background: rgba(100, 200, 255, 0.15);
    border-color: rgba(100, 200, 255, 0.3);
    transform: translateY(-1px);
}

.story-counter {
    font-size: 13px;
    font-weight: 600;
    color: #64c8ff;
    opacity: 0.8;
    cursor: help;
    padding: 4px 10px;
    background: rgba(100, 200, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s;
    border: 1px solid rgba(100, 200, 255, 0.15);
}

.story-counter:hover {
    opacity: 1;
    background: rgba(100, 200, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(100, 200, 255, 0.2);
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-separator {
    color: #64c8ff;
    opacity: 0.5;
    font-size: 13px;
    /* Hide from screen readers */
    aria-hidden: true;
}

.filter-select-inline {
    background: rgba(100, 200, 255, 0.08);
    color: #64c8ff;
    border: 1px solid rgba(100, 200, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    font-weight: 600;
    transition: all 0.2s;
}

.filter-select-inline:hover {
    background: rgba(100, 200, 255, 0.12);
    border-color: rgba(100, 200, 255, 0.3);
}

.filter-select-inline:focus {
    outline: 2px solid rgba(100, 200, 255, 0.5);
    outline-offset: 1px;
}

/* ========== CARD STYLES ========== */
.card-stack {
    position: absolute;
    top: calc(50px + env(safe-area-inset-top));
    left: 0;
    width: 100%;
    height: calc(100% - 50px - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    perspective: 1000px;
    z-index: 1;
    overflow: hidden;
    pointer-events: auto;
}

.story-card {
    position: absolute;
    width: calc(100% - 20px);
    height: calc(100% - 140px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-width: 500px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -48%);
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: grab;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    will-change: transform;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 10px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.story-card[data-high-score="true"] {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 10px 20px rgba(0, 0, 0, 0.3), 0 0 20px rgba(100, 200, 255, 0.3);
}

.story-card[data-super-score="true"] {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 10px 20px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 200, 100, 0.4);
}

.story-card.dragging {
    transition: none;
    cursor: grabbing;
}

.story-card.flying-out {
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.story-card.preview {
    transform: translate(-50%, -48%) translateZ(-50px) scale(0.92);
    opacity: 0.3;
    z-index: -1;
    pointer-events: none;
    filter: blur(1px);
}

.card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.card-header-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    z-index: 1;
    border-radius: 20px 20px 0 0;
}

.card-body-gradient {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    border-radius: 0 0 20px 20px;
}

.card-content {
    padding: 20px 15px 160px 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.card-category {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    align-self: flex-start;
    transition: all 0.3s;
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    white-space: nowrap;
}

.card-category:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-category:active {
    transform: scale(0.98);
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.card-thumbnail {
    width: 100%;
    height: 120px;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    opacity: 0.9;
    flex-wrap: wrap;
}

.card-meta .time-display {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.card-summary-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.card-summary {
    height: 100%;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
    -webkit-overflow-scrolling: touch;
    padding-right: 10px;
    padding-bottom: 10px;
}

.card-summary::-webkit-scrollbar {
    width: 4px;
}

.card-summary::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.card-summary::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* ========== SENTIMENT INDICATORS ========== */
.sentiment-meters {
    position: absolute;
    bottom: 72px; /* Moved up slightly for better spacing with actions */
    left: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 10px;
    border-radius: 10px;
    backdrop-filter: blur(15px);
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sentiment-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.sentiment-item {
    text-align: center;
    padding: 2px;
}

.sentiment-value {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 1px;
    transition: all 0.3s ease;
}

/* Add glow effect for extreme values */
.sentiment-value[style*="#e74c3c"] {
    text-shadow: 0 0 8px currentColor;
}

.sentiment-value[style*="#f39c12"] {
    text-shadow: 0 0 5px currentColor;
}

.sentiment-label {
    font-size: 8px;
    text-transform: uppercase;
    opacity: 0.5;
    letter-spacing: 0.3px;
}

/* ========== ACTION BUTTONS ========== */
.card-actions {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-around;
    gap: 6px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px;
    border-radius: 10px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.action-btn {
    flex: 1;
    padding: 8px 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.action-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn.upvote:active {
    background: rgba(76, 175, 80, 0.25);
}

.action-btn.upvote.voted {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.4);
}

.action-btn.downvote:active {
    background: rgba(244, 67, 54, 0.25);
}

.action-btn.downvote.voted {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.4);
}

@media (hover: hover) {
    .action-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-1px);
    }
}

.action-btn span {
    font-size: 9px;
}

/* ========== NAVIGATION HINTS ========== */
.nav-hints {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    pointer-events: none;
    z-index: 5;
}

.nav-hint {
    position: absolute;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    animation: hintPulse 3s infinite;
}

.nav-hint.top {
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
}

.nav-hint.bottom {
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
}

.nav-hint.left {
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
}

.nav-hint.right {
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
}

/* ========== MODAL STYLES ========== */
.tutorial {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 40px;
    backdrop-filter: blur(20px);
}

.tutorial-content {
    text-align: center;
    max-width: 400px;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.tutorial-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(100, 200, 255, 0.1) 0%, transparent 70%);
    animation: tutorialGlow 8s ease-in-out infinite;
}

@keyframes tutorialGlow {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.tutorial-logo {
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
    animation: tutorialLogoFloat 4s ease-in-out infinite;
}

@keyframes tutorialLogoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.tutorial-logo svg {
    margin: 0 auto;
    display: block;
}

.tutorial h2 {
    font-size: 32px;
    margin-bottom: 16px;
    color: #fff;
    font-weight: 300;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}

.tutorial-subtitle {
    margin-bottom: 40px;
    opacity: 0.6;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.tutorial-item {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
    text-align: left;
    position: relative;
    z-index: 1;
}

.tutorial-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 200, 255, 0.1);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 12px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tutorial-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(100, 200, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.tutorial-item:hover .tutorial-icon::before {
    width: 100%;
    height: 100%;
}

.tutorial-icon svg {
    width: 24px;
    height: 24px;
    stroke: #64c8ff;
    stroke-width: 2;
    fill: none;
    position: relative;
    z-index: 1;
}

.tutorial-text {
    flex: 1;
    font-size: 15px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

.tutorial-btn {
    background: rgba(100, 200, 255, 0.15);
    color: #64c8ff;
    border: 1px solid rgba(100, 200, 255, 0.3);
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 400;
    border-radius: 30px;
    margin-top: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    letter-spacing: 1px;
    text-transform: uppercase;
    overflow: hidden;
}

.tutorial-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(100, 200, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.tutorial-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(100, 200, 255, 0.3);
    background: rgba(100, 200, 255, 0.2);
}

.tutorial-btn:hover::before {
    width: 300px;
    height: 300px;
}

.tutorial-btn:active {
    transform: translateY(0);
}

.category-selector {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 40px;
    backdrop-filter: blur(20px);
}

.category-selector.show {
    display: flex;
}

.category-list {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    padding: 32px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.category-list::-webkit-scrollbar {
    width: 4px;
}

.category-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.category-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.category-list h3 {
    color: #fff;
    margin-bottom: 24px;
    text-align: center;
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 2px;
}

.category-list h4 {
    color: #64c8ff;
    margin: 24px 0 16px 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}

/* Enhanced category option styling */
.category-option {
    padding: 16px 20px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
    font-weight: 400;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.9);
}

.category-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(100, 200, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.category-option:hover {
    background: rgba(100, 200, 255, 0.1);
    transform: translateX(4px);
    border-color: rgba(100, 200, 255, 0.3);
}

.category-option:hover::before {
    left: 100%;
}

.category-option.active {
    background: rgba(100, 200, 255, 0.15);
    border: 1px solid rgba(100, 200, 255, 0.3);
    color: #64c8ff;
}

.category-count {
    font-size: 13px;
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
}

/* Enhanced sort option styling */
.sort-option {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sort-option:hover {
    background: rgba(100, 200, 255, 0.1);
    border-color: rgba(100, 200, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(100, 200, 255, 0.2);
}

.sort-option.active {
    background: rgba(100, 200, 255, 0.2);
    border: 1px solid rgba(100, 200, 255, 0.5);
    color: #64c8ff;
    transform: none;
    box-shadow: 0 0 0 1px rgba(100, 200, 255, 0.5);
}

/* Special button styling */
.category-list button {
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Clear history button */
.category-list button[onclick*="Clear all"] {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #ff5252;
}

.category-list button[onclick*="Clear all"]:hover {
    background: rgba(244, 67, 54, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(244, 67, 54, 0.2);
}

/* Force refresh button */
.category-list button[onclick*="Force refresh"] {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #ff9800;
}

.category-list button[onclick*="Force refresh"]:hover {
    background: rgba(255, 152, 0, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 152, 0, 0.2);
}

.category-list button:active {
    transform: translateY(0);
}

.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(20px);
}

.info-modal.show {
    display: flex;
}

.info-content {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    padding: 36px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.info-content::-webkit-scrollbar {
    width: 4px;
}

.info-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.info-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.info-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #64c8ff;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.info-close:hover {
    opacity: 1;
    background: rgba(100, 200, 255, 0.1);
    transform: rotate(90deg);
}

.info-content h2 {
    color: #fff;
    margin-bottom: 28px;
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 2px;
}

.info-section {
    margin-bottom: 32px;
}

.info-section h3 {
    color: #64c8ff;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}

.info-item {
    margin-bottom: 10px;
    padding-left: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.5;
}

.info-gesture {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.info-gesture:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.info-gesture-icon {
    color: #64c8ff;
    font-weight: 600;
    min-width: 60px;
    font-size: 14px;
    text-align: center;
    background: rgba(100, 200, 255, 0.1);
    padding: 8px;
    border-radius: 8px;
}

.info-gesture-text {
    flex: 1;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.info-indicator {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    transition: all 0.2s;
}

.info-indicator:hover {
    background: rgba(255, 255, 255, 0.04);
}

.info-indicator-label {
    color: #64c8ff;
    font-size: 13px;
    font-weight: 600;
}

.info-indicator-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.info-sort-current {
    padding: 20px;
    background: rgba(100, 200, 255, 0.1);
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    border: 1px solid rgba(100, 200, 255, 0.2);
}

.info-note {
    margin-top: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    font-style: italic;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ========== FEEDBACK & OVERLAYS ========== */
.swipe-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.swipe-feedback.show {
    animation: feedbackPop 0.6s ease;
}

.swipe-feedback.skip {
    font-size: 16px;
    background: rgba(102, 102, 102, 0.9);
}

/* ========== UTILITY CLASSES ========== */
.loading-text {
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: pulse 2s infinite;
}

.loading-text::after {
    content: 'drifting...';
}

/* ========== ANIMATIONS ========== */
@keyframes hintPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

@keyframes feedbackPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}
/* ========== PERSONAL STATS STYLES ========== */
/* Add this section to the end of your drift.css file */

/* Stats icon in header */
.stats-icon-btn {
    background: none;
    border: none;
    color: #64c8ff;
    cursor: pointer;
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.stats-icon-btn:hover {
    background: rgba(100, 200, 255, 0.1);
    transform: translateY(-1px);
}

.stats-icon-btn.stats-pulse::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #64c8ff;
    border-radius: 50%;
    top: 8px;
    right: 8px;
    animation: statsPulse 2s infinite;
}

@keyframes statsPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Personal stats modal */
.personal-stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    backdrop-filter: blur(20px);
}

.personal-stats-modal.show {
    display: flex;
}

.stats-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    padding: 36px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    animation: statsSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes statsSlideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.stats-container::-webkit-scrollbar {
    width: 4px;
}

.stats-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.stats-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.stats-header h2 {
    color: #fff;
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 2px;
}

.stats-close {
    background: none;
    border: none;
    color: #64c8ff;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.stats-close:hover {
    opacity: 1;
    background: rgba(100, 200, 255, 0.1);
    transform: rotate(90deg);
}

/* Mood graph section */
.mood-graph-section {
    margin-bottom: 40px;
}

.section-title {
    color: #64c8ff;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}

.mood-graph {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.mood-graph::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(100, 200, 255, 0.3), transparent);
    animation: scanline 3s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(200px);
    }
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(100, 200, 255, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(100, 200, 255, 0.2);
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: #64c8ff;
    margin-bottom: 4px;
    transition: all 0.3s;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Streak displays */
.streak-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.streak-fire {
    font-size: 20px;
    animation: fireFlicker 1.5s infinite alternate;
}

@keyframes fireFlicker {
    0% {
        transform: scale(1) rotate(-5deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(0.95) rotate(-3deg);
    }
}

/* Category breakdown */
.category-breakdown {
    margin-bottom: 32px;
}

.category-bar {
    margin-bottom: 12px;
}

.category-bar-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-bar-track {
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.category-bar-fill {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 12px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.category-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

.category-bar-percent {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Personal insights */
.insights-section {
    margin-bottom: 32px;
}

.insights-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s;
    animation: insightFadeIn 0.5s ease backwards;
}

.insight-item:nth-child(1) { animation-delay: 0.1s; }
.insight-item:nth-child(2) { animation-delay: 0.2s; }
.insight-item:nth-child(3) { animation-delay: 0.3s; }
.insight-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes insightFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.insight-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

/* Action buttons */
.stats-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.stats-btn-primary {
    background: rgba(100, 200, 255, 0.15);
    color: #64c8ff;
    border-color: rgba(100, 200, 255, 0.3);
}

.stats-btn-primary:hover {
    background: rgba(100, 200, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(100, 200, 255, 0.2);
}

.stats-btn-secondary {
    background: rgba(244, 67, 54, 0.1);
    color: #ff5252;
    border-color: rgba(244, 67, 54, 0.3);
}

.stats-btn-secondary:hover {
    background: rgba(244, 67, 54, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(244, 67, 54, 0.2);
}

/* Mood meter for current session */
.mood-meter {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
    position: relative;
}

.mood-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff5252 0%, #ff9800 25%, #ffeb3b 50%, #8bc34a 75%, #4caf50 100%);
    width: 50%;
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.mood-meter-marker {
    position: absolute;
    top: -4px;
    right: -2px;
    width: 4px;
    height: 16px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .stats-container {
        padding: 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-actions {
        flex-direction: column;
    }
    
    .stat-value {
        font-size: 24px;
    }
}