@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
        
        .reddit-explorer-wrapper * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        .reddit-explorer-wrapper {
            font-family: 'Space Grotesk', sans-serif;
            background: #0f172a;
            color: #e2e8f0;
            line-height: 1.6;
            overflow-x: hidden;
            min-height: 100vh;
        }

        :root {
            --primary-color: #22d3ee;
            --primary-light: #67e8f9;
            --primary-dark: #0891b2;
            --secondary-color: #a855f7;
            --secondary-light: #c084fc;
            --secondary-dark: #7e22ce;
            --accent-color: #f59e0b;
            --accent-light: #fbbf24;
            --accent-dark: #d97706;
            --bg-primary: #0f172a;
            --bg-secondary: #1e293b;
            --bg-tertiary: #334155;
            --bg-card: #1e293b;
            --glass-bg: rgba(34, 211, 238, 0.1);
            --glass-border: rgba(34, 211, 238, 0.2);
            --text-primary: #e2e8f0;
            --text-secondary: #cbd5e1;
            --text-muted: #94a3b8;
            --text-accent: #67e8f9;
            --shadow-sm: 0 2px 8px rgba(34, 211, 238, 0.1);
            --shadow-md: 0 4px 16px rgba(34, 211, 238, 0.15);
            --shadow-lg: 0 8px 32px rgba(34, 211, 238, 0.2);
            --shadow-xl: 0 16px 48px rgba(34, 211, 238, 0.25);
            --gradient-primary: linear-gradient(135deg, #22d3ee, #0891b2);
            --gradient-secondary: linear-gradient(135deg, #a855f7, #7e22ce);
            --gradient-accent: linear-gradient(135deg, #f59e0b, #d97706);
        }

        .reddit-explorer-main {
            max-width: 1400px;
            margin: 0 auto;
            padding: 20px;
            position: relative;
        }

        .reddit-explorer-top-section {
            text-align: center;
            margin-bottom: 50px;
            padding: 40px 0;
            animation: fadeInDown 1s ease-out;
        }

        .reddit-explorer-brand {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 20px;
            margin-bottom: 25px;
            flex-wrap: wrap;
        }

        .reddit-explorer-icon {
            width: 80px;
            height: 80px;
            background: var(--gradient-primary);
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 36px;
            font-weight: 800;
            box-shadow: var(--shadow-lg);
            animation: float 3s ease-in-out infinite;
            position: relative;
            overflow: hidden;
        }

        .reddit-explorer-icon::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            transform: rotate(45deg);
            animation: shine 3s infinite;
        }

        .reddit-explorer-tag {
            background: var(--gradient-secondary);
            color: white;
            padding: 8px 16px;
            border-radius: 25px;
            font-size: 14px;
            font-weight: 700;
            box-shadow: var(--shadow-md);
            animation: pulse 2s infinite;
        }

        .reddit-explorer-name {
            font-size: clamp(2.5rem, 6vw, 4rem);
            font-weight: 900;
            background: var(--gradient-primary);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            letter-spacing: -1px;
            text-shadow: 0 0 30px rgba(34, 211, 238, 0.5);
        }

        .reddit-explorer-description {
            color: var(--text-secondary);
            font-size: 18px;
            font-weight: 500;
            margin-bottom: 30px;
            max-width: 700px;
            margin-left: auto;
            margin-right: auto;
        }

        .reddit-explorer-features {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 40px;
        }

        .reddit-explorer-feature {
            background: var(--bg-card);
            border: 1px solid var(--glass-border);
            padding: 15px;
            border-radius: 16px;
            text-align: center;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }

        .reddit-explorer-feature::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.1), transparent);
            transition: left 0.5s;
        }

        .reddit-explorer-feature:hover::before {
            left: 100%;
        }

        .reddit-explorer-feature:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-lg);
            border-color: var(--primary-color);
        }

        .reddit-explorer-feature-icon {
            width: 40px;
            height: 40px;
            background: var(--gradient-primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 10px;
            font-size: 20px;
            color: white;
        }

        .reddit-explorer-feature-label {
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 8px;
            font-size: 14px;
        }

        .reddit-explorer-search-box {
            background: var(--bg-secondary);
            border: 1px solid var(--glass-border);
            padding: 30px;
            border-radius: 24px;
            box-shadow: var(--shadow-xl);
            margin-bottom: 40px;
            animation: fadeInUp 1s ease-out 0.2s both;
            position: relative;
            overflow: hidden;
        }

        .reddit-explorer-search-box::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: var(--gradient-primary);
        }

        .reddit-explorer-search-form {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
            position: relative;
        }

        .reddit-explorer-input {
            flex: 1 !important;
            padding: 15px 20px !important;
            border: 2px solid var(--bg-tertiary) !important;
            border-radius: 16px !important;
            font-size: 14px !important;
            font-weight: 500 !important;
            background: var(--bg-primary) !important;
            transition: all 0.3s ease !important;
            outline: none !important;
            color: var(--text-primary) !important;
            font-family: inherit !important;
        }

        .reddit-explorer-input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.1);
            transform: translateY(-2px);
        }

        .reddit-explorer-input::placeholder {
            color: var(--text-muted);
            font-weight: 400;
        }

        .reddit-explorer-button {
            padding: 15px 30px;
            background: var(--gradient-primary);
            color: white;
            border: none;
            border-radius: 16px;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            min-width: 150px;
            position: relative;
            overflow: hidden;
            box-shadow: var(--shadow-md);
            font-family: inherit;
        }

        .reddit-explorer-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s;
        }

        .reddit-explorer-button:hover::before {
            left: 100%;
        }

        .reddit-explorer-button:hover:not(:disabled) {
            transform: translateY(-3px);
            box-shadow: var(--shadow-lg);
        }

        .reddit-explorer-button:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .reddit-explorer-user-panel {
            background: var(--bg-secondary);
            border: 1px solid var(--glass-border);
            padding: 30px;
            border-radius: 24px;
            box-shadow: var(--shadow-xl);
            margin-bottom: 40px;
            display: none;
            animation: fadeInDown 0.8s ease-out;
            position: relative;
            overflow: hidden;
        }

        .reddit-explorer-user-panel::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: var(--gradient-secondary);
        }

        .reddit-explorer-user-header {
            display: flex;
            align-items: center;
            gap: 25px;
            margin-bottom: 25px;
        }

        .reddit-explorer-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: var(--gradient-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2.5rem;
            color: white;
            font-weight: 900;
            box-shadow: var(--shadow-lg);
            position: relative;
            overflow: hidden;
        }

        .reddit-explorer-avatar::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            transform: rotate(45deg);
            animation: shine 4s infinite;
        }

        .reddit-explorer-user-info .reddit-explorer-name {
            font-size: 2rem;
            color: var(--text-primary);
            margin-bottom: 8px;
            font-weight: 900;
        }

        .reddit-explorer-user-bio {
            color: var(--text-secondary);
            font-size: 16px;
            font-weight: 500;
        }

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

        .reddit-explorer-stat {
            background: var(--bg-card);
            border: 1px solid var(--glass-border);
            padding: 20px;
            border-radius: 20px;
            text-align: center;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .reddit-explorer-stat::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--gradient-accent);
        }

        .reddit-explorer-stat:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-md);
        }

        .reddit-explorer-stat-value {
            font-size: 1.8rem;
            font-weight: 900;
            color: var(--primary-color);
            margin-bottom: 6px;
        }

        .reddit-explorer-stat-key {
            font-size: 0.9rem;
            color: var(--text-secondary);
            font-weight: 600;
        }

        .reddit-explorer-content-area {
            display: none;
        }

        .reddit-explorer-section-heading {
            color: var(--text-primary);
            font-size: 2rem;
            font-weight: 900;
            margin-bottom: 30px;
            text-align: center;
            background: var(--bg-secondary);
            border: 1px solid var(--glass-border);
            padding: 20px;
            border-radius: 20px;
            position: relative;
            overflow: hidden;
        }

        .reddit-explorer-section-heading::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: var(--gradient-accent);
        }

        .reddit-explorer-posts {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
            gap: 25px;
        }

        .reddit-explorer-post {
            background: var(--bg-secondary);
            border: 1px solid var(--glass-border);
            border-radius: 20px;
            padding: 20px;
            box-shadow: var(--shadow-xl);
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            animation: slideUp 0.6s ease forwards;
            display: flex;
            flex-direction: column;
            height: 100%;
        }

        .reddit-explorer-post::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: var(--gradient-primary);
            border-radius: 20px 20px 0 0;
        }

        .reddit-explorer-post:hover {
            transform: translateY(-10px);
            box-shadow: 0 20px 40px rgba(34, 211, 238, 0.2);
            border-color: var(--primary-color);
        }

        .reddit-explorer-post-meta {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 15px;
            padding-bottom: 15px;
            border-bottom: 2px solid var(--bg-tertiary);
        }

        .reddit-explorer-subreddit {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .reddit-explorer-subreddit-tag {
            background: var(--gradient-primary);
            color: white;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 700;
            box-shadow: var(--shadow-sm);
        }

        .reddit-explorer-type {
            background: var(--gradient-secondary);
            color: white;
            padding: 4px 10px;
            border-radius: 15px;
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: capitalize;
        }

        .reddit-explorer-date {
            font-size: 0.8rem;
            color: var(--text-muted);
            font-weight: 500;
            text-align: right;
        }

        .reddit-explorer-labels {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 15px;
        }

        .reddit-explorer-label {
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.7rem;
            font-weight: 600;
            color: white;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .reddit-explorer-label.admin {
            background: var(--gradient-accent);
        }

        .reddit-explorer-label.stickied {
            background: var(--gradient-secondary);
        }

        .reddit-explorer-label.archived {
            background: linear-gradient(135deg, #64748b, #475569);
        }

        .reddit-explorer-label.locked {
            background: var(--gradient-accent);
        }

        .reddit-explorer-label.nsfw {
            background: linear-gradient(135deg, #7c3aed, #5b21b6);
        }

        .reddit-explorer-post-title {
            font-size: 1.4rem;
            font-weight: 700;
            margin-bottom: 15px;
            color: var(--text-primary);
            line-height: 1.4;
        }

        .reddit-explorer-post-body {
            margin-bottom: 20px;
            flex-grow: 1;
        }

        .reddit-explorer-text {
            color: var(--text-secondary);
            line-height: 1.6;
            margin-bottom: 15px;
            font-weight: 400;
            font-size: 14px;
        }

        .reddit-explorer-media {
            margin: 15px 0;
            border-radius: 16px;
            overflow: hidden;
            position: relative;
            box-shadow: var(--shadow-md);
            background: #000;
        }

        .reddit-explorer-image {
            width: 100%;
            max-height: 300px;
            object-fit: cover;
            cursor: pointer;
            transition: transform 0.3s ease;
        }

        .reddit-explorer-image:hover {
            transform: scale(1.02);
        }

        .reddit-explorer-video-wrapper {
            position: relative;
            width: 100%;
            background: #000;
            border-radius: 16px;
            overflow: hidden;
        }

        .reddit-explorer-video {
            width: 100%;
            height: 250px;
            border-radius: 16px;
        }

        .reddit-explorer-controls {
            display: flex;
            gap: 10px;
            margin-top: 15px;
            flex-wrap: wrap;
            align-items: center;
        }

        .reddit-explorer-control {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 18px;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 600;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            font-family: inherit;
            position: relative;
            overflow: hidden;
        }

        .reddit-explorer-control::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s;
        }

        .reddit-explorer-control:hover::before {
            left: 100%;
        }

        .reddit-explorer-audio-btn {
            background: var(--gradient-secondary);
            color: white;
            box-shadow: var(--shadow-md);
        }

        .reddit-explorer-audio-btn:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow-lg);
        }

        .reddit-explorer-audio-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .reddit-explorer-audio-btn.loading {
            background: linear-gradient(135deg, #64748b, #475569);
        }

        .reddit-explorer-download {
            background: var(--gradient-accent);
            color: white;
            box-shadow: var(--shadow-md);
        }

        .reddit-explorer-download:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow-lg);
        }

        .reddit-explorer-download:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .reddit-explorer-download.downloading {
            background: var(--gradient-primary);
        }

        .reddit-explorer-external {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: var(--gradient-primary);
            color: white;
            padding: 10px 18px;
            border-radius: 12px;
            text-decoration: none;
            margin-top: 15px;
            transition: all 0.3s ease;
            font-weight: 600;
            box-shadow: var(--shadow-sm);
            font-size: 0.9rem;
        }

        .reddit-explorer-external:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow-md);
        }

        .reddit-explorer-metrics {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            margin-top: auto;
            padding-top: 15px;
            border-top: 2px solid var(--bg-tertiary);
        }

        .reddit-explorer-metric {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            padding: 12px;
            background: var(--bg-card);
            border: 1px solid var(--glass-border);
            border-radius: 15px;
            text-align: center;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .reddit-explorer-metric::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: var(--gradient-accent);
        }

        .reddit-explorer-metric:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow-sm);
        }

        .reddit-explorer-metric-value {
            font-weight: 900;
            font-size: 1.2rem;
        }

        .reddit-explorer-metric-label {
            font-size: 0.8rem;
            color: var(--text-muted);
            font-weight: 600;
            text-transform: capitalize;
        }

        .reddit-explorer-upvotes .reddit-explorer-metric-value {
            color: var(--primary-color);
        }

        .reddit-explorer-comments .reddit-explorer-metric-value {
            color: var(--secondary-color);
        }

        .reddit-explorer-loader {
            text-align: center;
            padding: 40px;
            color: var(--text-primary);
            font-size: 1.1rem;
            display: none;
        }

        .reddit-explorer-spinner {
            border: 4px solid var(--bg-tertiary);
            border-top: 4px solid var(--primary-color);
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
            margin: 20px auto;
        }

        .reddit-explorer-error {
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.2);
            color: #ef4444;
            padding: 20px;
            border-radius: 16px;
            text-align: center;
            margin: 20px 0;
            font-weight: 600;
            display: none;
            font-size: 14px;
        }

        .reddit-explorer-popup {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.95);
            animation: fadeIn 0.3s ease;
        }

        .reddit-explorer-popup-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            max-width: 90%;
            max-height: 90%;
        }

        .reddit-explorer-popup img {
            width: 100%;
            height: auto;
            border-radius: 20px;
        }

        .reddit-explorer-close {
            position: absolute;
            top: 20px;
            right: 40px;
            color: #f1f1f1;
            font-size: 45px;
            font-weight: bold;
            cursor: pointer;
            z-index: 1001;
        }

        .reddit-explorer-close:hover {
            color: var(--primary-color);
        }

        .reddit-explorer-progress {
            position: fixed;
            bottom: 25px;
            right: 25px;
            background: var(--bg-secondary);
            border: 1px solid var(--glass-border);
            border-radius: 20px;
            padding: 25px;
            min-width: 350px;
            box-shadow: var(--shadow-xl);
            z-index: 1000;
            display: none;
            color: var(--text-primary);
        }

        .reddit-explorer-progress.show {
            display: block;
            animation: slideInRight 0.4s ease-out;
        }

        .reddit-explorer-progress-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .reddit-explorer-progress-text {
            font-weight: 700;
            font-size: 14px;
            color: var(--text-primary);
        }

        .reddit-explorer-cancel {
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.2);
            color: #ef4444;
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 600;
        }

        .reddit-explorer-cancel:hover {
            background: rgba(239, 68, 68, 0.15);
        }

        .reddit-explorer-progress-bar {
            width: 100%;
            height: 12px;
            background: var(--bg-tertiary);
            border-radius: 6px;
            overflow: hidden;
            margin-bottom: 12px;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        .reddit-explorer-progress-fill {
            height: 100%;
            background: var(--gradient-primary);
            border-radius: 6px;
            width: 0%;
            transition: width 0.3s ease;
            box-shadow: 0 2px 8px rgba(34, 211, 238, 0.4);
        }

        .reddit-explorer-progress-info {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .reddit-explorer-expand {
            background: var(--gradient-primary);
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 12px;
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 600;
            margin-top: 10px;
            transition: all 0.3s ease;
            font-family: inherit;
        }

        .reddit-explorer-expand:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-sm);
        }

        .reddit-explorer-play-overlay {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0, 0, 0, 0.7);
            border: none;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            color: white;
            font-size: 20px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            z-index: 5;
        }

        .reddit-explorer-play-overlay:hover {
            background: rgba(0, 0, 0, 0.9);
            transform: translate(-50%, -50%) scale(1.1);
        }

        .reddit-explorer-play-overlay.hidden {
            display: none;
        }

        .reddit-explorer-new-search {
            background: var(--gradient-accent) !important;
            min-width: 130px;
        }

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

        @keyframes shine {
            0% {
                transform: translateX(-100%) translateY(-100%) rotate(45deg);
            }
            100% {
                transform: translateX(100%) translateY(100%) rotate(45deg);
            }
        }

        @keyframes fadeInDown {
            from {
                opacity: 0;
                transform: translateY(-30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(100%);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(40px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }
            100% {
                transform: rotate(360deg);
            }
        }

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

        @keyframes fadeIn {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }

        .reddit-explorer-loading-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            color: white;
            font-weight: 600;
            z-index: 10;
        }

        .reddit-explorer-loading-spinner {
            width: 30px;
            height: 30px;
            border: 3px solid rgba(255, 255, 255, 0.3);
            border-top: 3px solid white;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 10px;
        }

        /* Responsive Design */
        @media (max-width: 1200px) {
            .reddit-explorer-posts {
                grid-template-columns: 1fr;
            }
            .reddit-explorer-features {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 992px) {
            .reddit-explorer-name {
                font-size: 2.5rem;
            }
            .reddit-explorer-section-heading {
                font-size: 1.8rem;
            }
            .reddit-explorer-post-title {
                font-size: 1.2rem;
            }
            .reddit-explorer-search-form {
                flex-direction: column !important;
            }
        }

        @media (max-width: 768px) {
            .reddit-explorer-features {
                grid-template-columns: 1fr;
            }
            .reddit-explorer-stats {
                grid-template-columns: repeat(2, 1fr);
            }
            .reddit-explorer-metrics {
                grid-template-columns: repeat(2, 1fr);
                gap: 8px;
            }
            .reddit-explorer-controls {
                flex-direction: column;
            }
            .reddit-explorer-control {
                width: 100%;
                justify-content: center;
            }
            .reddit-explorer-search-form {
                flex-direction: column;
            }
            .reddit-explorer-name {
                font-size: 2rem;
            }
            .reddit-explorer-description {
                font-size: 16px;
            }
            .reddit-explorer-section-heading {
                font-size: 1.6rem;
            }
            .reddit-explorer-post-title {
                font-size: 1.1rem;
            }
					.reddit-explorer-brand {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin-bottom: 25px;
	flex-wrap: wrap;
	margin-top: 30px;
}
        }

        @media (max-width: 600px) {
            .reddit-explorer-main {
                padding: 15px;
            }
            .reddit-explorer-search-box,
            .reddit-explorer-user-panel,
            .reddit-explorer-post {
                padding: 20px;
            }
            .reddit-explorer-posts {
                grid-template-columns: 1fr;
            }
            .reddit-explorer-icon {
                width: 60px;
                height: 60px;
                font-size: 28px;
            }
            .reddit-explorer-avatar {
                width: 60px;
                height: 60px;
                font-size: 2rem;
            }
            .reddit-explorer-name {
                font-size: 1.8rem;
            }
            .reddit-explorer-description {
                font-size: 14px;
            }
            .reddit-explorer-section-heading {
                font-size: 1.4rem;
            }
            .reddit-explorer-post-title {
                font-size: 1rem;
            }
					.reddit-explorer-brand {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin-bottom: 25px;
	flex-wrap: wrap;
	margin-top: 30px;
}
        }

        @media (max-width: 480px) {
            .reddit-explorer-metrics {
                grid-template-columns: 1fr;
            }
            .reddit-explorer-stats {
                grid-template-columns: 1fr;
            }
            .reddit-explorer-main {
                padding: 10px;
            }
            .reddit-explorer-search-box,
            .reddit-explorer-user-panel,
            .reddit-explorer-post {
                padding: 15px;
            }
            .reddit-explorer-icon {
                width: 50px;
                height: 50px;
                font-size: 24px;
            }
            .reddit-explorer-avatar {
                width: 50px;
                height: 50px;
                font-size: 1.8rem;
            }
            .reddit-explorer-name {
                font-size: 1.6rem;
            }
            .reddit-explorer-description {
                font-size: 13px;
            }
            .reddit-explorer-section-heading {
                font-size: 1.2rem;
            }
            .reddit-explorer-post-title {
                font-size: 0.9rem;
            }
					.reddit-explorer-brand {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin-bottom: 25px;
	flex-wrap: wrap;
	margin-top: 30px;
}
        }

        @media (max-width: 400px) {
            .reddit-explorer-main {
                padding: 8px;
            }
            .reddit-explorer-search-box,
            .reddit-explorer-user-panel,
            .reddit-explorer-post {
                padding: 12px;
            }
            .reddit-explorer-icon {
                width: 45px;
                height: 45px;
                font-size: 22px;
            }
            .reddit-explorer-avatar {
                width: 45px;
                height: 45px;
                font-size: 1.6rem;
            }
            .reddit-explorer-name {
                font-size: 1.4rem;
            }
            .reddit-explorer-description {
                font-size: 12px;
            }
            .reddit-explorer-section-heading {
                font-size: 1.1rem;
            }
            .reddit-explorer-post-title {
                font-size: 0.85rem;
            }
					.reddit-explorer-brand {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin-bottom: 25px;
	flex-wrap: wrap;
	margin-top: 30px;
}
        }

        @media (max-width: 375px) {
            .reddit-explorer-main {
                padding: 5px;
            }
            .reddit-explorer-search-box,
            .reddit-explorer-user-panel,
            .reddit-explorer-post {
                padding: 10px;
            }
            .reddit-explorer-icon {
                width: 40px;
                height: 40px;
                font-size: 20px;
            }
            .reddit-explorer-avatar {
                width: 40px;
                height: 40px;
                font-size: 1.4rem;
            }
            .reddit-explorer-name {
                font-size: 1.2rem;
            }
            .reddit-explorer-description {
                font-size: 11px;
            }
            .reddit-explorer-section-heading {
                font-size: 1rem;
            }
            .reddit-explorer-post-title {
                font-size: 0.8rem;
            }
					.reddit-explorer-brand {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin-bottom: 25px;
	flex-wrap: wrap;
	margin-top: 30px;
}
        }

/* --- Codex CSS updates --- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

.reddit-explorer-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.reddit-explorer-wrapper {
    font-family: 'Space Grotesk', sans-serif;
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 69, 0, 0.18), transparent 32%),
        radial-gradient(circle at 90% 0%, rgba(0, 121, 211, 0.16), transparent 34%),
        linear-gradient(180deg, #fff7ed 0%, #f8fafc 42%, #eef2f7 100%);
    color: #172033;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    width: 100%;
    position: relative;
    isolation: isolate;
    --primary-color: #ff4500;
    --primary-light: #ff875f;
    --primary-dark: #c93600;
    --secondary-color: #0079d3;
    --secondary-light: #38a3f1;
    --secondary-dark: #005fa8;
    --accent-color: #16a34a;
    --accent-light: #4ade80;
    --accent-dark: #15803d;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --bg-primary: #fffaf5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --bg-card: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(15, 23, 42, 0.1);
    --text-primary: #172033;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-accent: #c93600;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 22px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 14px 34px rgba(15, 23, 42, 0.14);
    --shadow-xl: 0 20px 52px rgba(15, 23, 42, 0.16);
    --gradient-primary: linear-gradient(135deg, #ff4500, #ff7a3d);
    --gradient-secondary: linear-gradient(135deg, #0079d3, #38a3f1);
    --gradient-accent: linear-gradient(135deg, #16a34a, #22c55e);
}

.reddit-explorer-main {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: clamp(18px, 3vw, 32px);
    position: relative;
}

.reddit-explorer-top-section {
    text-align: center;
    margin-bottom: 34px;
    padding: clamp(28px, 5vw, 54px) 0 22px;
    animation: fadeInDown 1s ease-out;
}

.reddit-explorer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.reddit-explorer-icon {
    width: 78px;
    height: 78px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 34px;
    font-weight: 800;
    box-shadow: var(--shadow-lg);
    animation: float 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
}

.reddit-explorer-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

.reddit-explorer-tag {
    background: var(--gradient-secondary);
    color: white;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    animation: pulse 2s infinite;
}

.reddit-explorer-name {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    background: linear-gradient(135deg, #c93600 0%, #ff4500 42%, #0079d3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.reddit-explorer-description {
    color: var(--text-secondary);
    font-size: clamp(15px, 2vw, 18px);
    font-weight: 500;
    margin-bottom: 20px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.reddit-explorer-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 34px;
}

.reddit-explorer-feature {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--glass-border);
    padding: 18px 14px;
    border-radius: 14px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.reddit-explorer-feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 69, 0, 0.1), transparent);
    transition: left 0.5s;
}

.reddit-explorer-feature:hover::before {
    left: 100%;
}

.reddit-explorer-feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 69, 0, 0.32);
}

.reddit-explorer-feature-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 20px;
    color: white;
}

.reddit-explorer-feature-label {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
    font-size: 14px;
}

.reddit-explorer-search-box {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--glass-border);
    padding: clamp(20px, 3vw, 30px);
    border-radius: 18px;
    box-shadow: var(--shadow-xl);
    margin-bottom: 28px;
    animation: fadeInUp 1s ease-out 0.2s both;
    position: relative;
    overflow: hidden;
}

.reddit-explorer-search-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff4500, #0079d3, #16a34a);
}

.reddit-explorer-search-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
    width: 100%;
}

.reddit-explorer-input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
    padding: 15px 18px !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    background: #ffffff !important;
    transition: all 0.3s ease !important;
    outline: none !important;
    color: var(--text-primary) !important;
    font-family: inherit !important;
}

.reddit-explorer-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(255, 69, 0, 0.14) !important;
    transform: translateY(-1px);
}

.reddit-explorer-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.reddit-explorer-button {
    padding: 15px 24px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 148px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    font-family: inherit;
    white-space: nowrap;
}

.reddit-explorer-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
    transition: left 0.5s;
}

.reddit-explorer-button:hover::before {
    left: 100%;
}

.reddit-explorer-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.reddit-explorer-button:focus-visible,
.reddit-explorer-control:focus-visible,
.reddit-explorer-cancel:focus-visible,
.reddit-explorer-expand:focus-visible,
.reddit-explorer-external:focus-visible,
.reddit-explorer-play-overlay:focus-visible {
    outline: 3px solid rgba(0, 121, 211, 0.34);
    outline-offset: 3px;
}

.reddit-explorer-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.reddit-explorer-user-panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--glass-border);
    padding: clamp(20px, 3vw, 30px);
    border-radius: 18px;
    box-shadow: var(--shadow-xl);
    margin-bottom: 34px;
    display: none;
    animation: fadeInDown 0.8s ease-out;
    position: relative;
    overflow: hidden;
}

.reddit-explorer-user-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-secondary);
}

.reddit-explorer-user-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    min-width: 0;
}

.reddit-explorer-avatar {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.35rem;
    color: white;
    font-weight: 900;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
}

.reddit-explorer-avatar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transform: rotate(45deg);
    animation: shine 4s infinite;
}

.reddit-explorer-user-info {
    min-width: 0;
}

.reddit-explorer-user-info .reddit-explorer-name {
    font-size: clamp(1.35rem, 3vw, 2rem);
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 900;
}

.reddit-explorer-user-bio {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.reddit-explorer-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.reddit-explorer-stat {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 18px;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.reddit-explorer-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}

.reddit-explorer-stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.reddit-explorer-stat-value {
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

.reddit-explorer-stat-key {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.reddit-explorer-content-area {
    display: none;
}

.reddit-explorer-section-heading {
    color: var(--text-primary);
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 900;
    margin-bottom: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--glass-border);
    padding: 18px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.reddit-explorer-section-heading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
}

.reddit-explorer-posts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.reddit-explorer-post {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow-xl);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease forwards;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

.reddit-explorer-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 18px 18px 0 0;
}

.reddit-explorer-post:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
    border-color: rgba(255, 69, 0, 0.36);
}

.reddit-explorer-post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--bg-tertiary);
}

.reddit-explorer-subreddit {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.reddit-explorer-subreddit-tag {
    background: var(--gradient-primary);
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
    overflow-wrap: anywhere;
}

.reddit-explorer-type {
    background: var(--gradient-secondary);
    color: white;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
}

.reddit-explorer-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-align: right;
    flex: 0 0 auto;
}

.reddit-explorer-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.reddit-explorer-label {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0;
}

.reddit-explorer-label.admin,
.admin {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.reddit-explorer-label.stickied,
.stickied {
    background: var(--gradient-secondary);
}

.reddit-explorer-label.archived,
.archived {
    background: linear-gradient(135deg, #64748b, #475569);
}

.reddit-explorer-label.locked,
.locked {
    background: linear-gradient(135deg, #b45309, #d97706);
}

.reddit-explorer-label.nsfw,
.nsfw {
    background: linear-gradient(135deg, #be123c, #e11d48);
}

.reddit-explorer-post-title {
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 800;
    margin-bottom: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.reddit-explorer-post-body {
    margin-bottom: 20px;
    flex-grow: 1;
    min-width: 0;
}

.reddit-explorer-text {
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 15px;
    font-weight: 400;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.reddit-explorer-media {
    margin: 15px 0;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    background: #020617;
}

.reddit-explorer-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
}

.reddit-explorer-image:hover {
    transform: scale(1.02);
}

.reddit-explorer-video-wrapper {
    position: relative;
    width: 100%;
    background: #020617;
    border-radius: 14px;
    overflow: hidden;
}

.reddit-explorer-video {
    width: 100%;
    height: 250px;
    border-radius: 14px;
    display: block;
}

.reddit-explorer-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.reddit-explorer-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.reddit-explorer-control::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transition: left 0.5s;
}

.reddit-explorer-control:hover::before {
    left: 100%;
}

.reddit-explorer-audio-btn {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: var(--shadow-md);
}

.reddit-explorer-audio-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.reddit-explorer-audio-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.reddit-explorer-audio-btn.loading {
    background: linear-gradient(135deg, #64748b, #475569);
}

.reddit-explorer-download {
    background: var(--gradient-accent);
    color: white;
    box-shadow: var(--shadow-md);
}

.reddit-explorer-download:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.reddit-explorer-download:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.reddit-explorer-download.downloading {
    background: var(--gradient-primary);
}

.reddit-explorer-external {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--gradient-primary);
    color: white;
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    margin-top: 15px;
    transition: all 0.3s ease;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
    max-width: 100%;
}

.reddit-explorer-external:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.reddit-explorer-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--bg-tertiary);
}

.reddit-explorer-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.reddit-explorer-metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-accent);
}

.reddit-explorer-metric:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.reddit-explorer-metric-value {
    font-weight: 900;
    font-size: 1.2rem;
    overflow-wrap: anywhere;
}

.reddit-explorer-metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: capitalize;
}

.reddit-explorer-upvotes .reddit-explorer-metric-value {
    color: var(--primary-color);
}

.reddit-explorer-comments .reddit-explorer-metric-value,
.reddit-explorer-comments {
    color: var(--secondary-color);
}

.reddit-explorer-loader {
    text-align: center;
    padding: 36px 18px;
    color: var(--text-primary);
    font-size: 1.05rem;
    display: none;
}

.reddit-explorer-spinner {
    border: 4px solid #dbe3ee;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

#searchSpinner {
    display: none;
    width: 20px;
    height: 20px;
    margin: 0;
    border-width: 3px;
}

.reddit-explorer-error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.22);
    color: #b91c1c;
    padding: 18px;
    border-radius: 14px;
    text-align: center;
    margin: 18px 0 0;
    font-weight: 700;
    display: none;
    font-size: 14px;
}

.reddit-explorer-popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(2, 6, 23, 0.92);
    animation: fadeIn 0.3s ease;
    padding: 24px;
}

.reddit-explorer-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: min(92vw, 1100px);
    max-height: 88vh;
}

.reddit-explorer-popup img {
    width: 100%;
    height: auto;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
}

.reddit-explorer-close {
    position: absolute;
    top: 18px;
    right: 28px;
    color: #ffffff;
    font-size: 44px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.reddit-explorer-close:hover {
    color: var(--primary-light);
    transform: scale(1.04);
}

.reddit-explorer-progress {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 22px;
    width: min(350px, calc(100vw - 32px));
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    display: none;
    color: var(--text-primary);
}

.reddit-explorer-progress.show {
    display: block;
    animation: slideInRight 0.4s ease-out;
}

.reddit-explorer-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.reddit-explorer-progress-text {
    font-weight: 800;
    font-size: 14px;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.reddit-explorer-cancel {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.22);
    color: #b91c1c;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 800;
    font-family: inherit;
    flex: 0 0 auto;
}

.reddit-explorer-cancel:hover {
    background: rgba(220, 38, 38, 0.16);
}

.reddit-explorer-progress-bar {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.08);
}

.reddit-explorer-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 999px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 69, 0, 0.35);
}

.reddit-explorer-progress-info {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.reddit-explorer-expand {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 11px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 10px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.reddit-explorer-expand:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.reddit-explorer-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(2, 6, 23, 0.74);
    border: none;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 5;
}

.reddit-explorer-play-overlay:hover {
    background: rgba(2, 6, 23, 0.92);
    transform: translate(-50%, -50%) scale(1.08);
}

.reddit-explorer-play-overlay.hidden {
    display: none;
}

.reddit-explorer-new-search {
    background: var(--gradient-secondary) !important;
    min-width: 132px;
}

.reddit-explorer-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
    font-weight: 700;
    z-index: 10;
    text-align: center;
    padding: 20px;
}

.reddit-explorer-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.02);
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(32px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.04);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 1200px) {
    .reddit-explorer-posts {
        grid-template-columns: 1fr;
    }

    .reddit-explorer-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .reddit-explorer-section-heading {
        font-size: 1.8rem;
    }

    .reddit-explorer-post-title {
        font-size: 1.2rem;
    }

    .reddit-explorer-search-form {
        flex-direction: column !important;
    }

    .reddit-explorer-button {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .reddit-explorer-main {
        padding: 16px;
    }

    .reddit-explorer-top-section {
        margin-bottom: 24px;
        padding-top: 30px;
    }

    .reddit-explorer-features {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .reddit-explorer-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reddit-explorer-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .reddit-explorer-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .reddit-explorer-control,
    .reddit-explorer-external {
        width: 100%;
        justify-content: center;
    }

    .reddit-explorer-user-header {
        align-items: flex-start;
    }

    .reddit-explorer-description {
        font-size: 16px;
    }

    .reddit-explorer-section-heading {
        font-size: 1.5rem;
    }

    .reddit-explorer-post-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .reddit-explorer-date {
        text-align: left;
    }

    .reddit-explorer-progress {
        right: 16px;
        bottom: 16px;
    }
}

@media (max-width: 600px) {
    .reddit-explorer-main {
        padding: 14px;
    }

    .reddit-explorer-search-box,
    .reddit-explorer-user-panel,
    .reddit-explorer-post {
        padding: 18px;
    }

    .reddit-explorer-posts {
        grid-template-columns: 1fr;
    }

    .reddit-explorer-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .reddit-explorer-avatar {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .reddit-explorer-description {
        font-size: 14px;
    }

    .reddit-explorer-section-heading {
        font-size: 1.35rem;
        padding: 16px;
    }

    .reddit-explorer-post-title {
        font-size: 1rem;
    }

    .reddit-explorer-brand {
        gap: 14px;
        margin-bottom: 18px;
    }

    .reddit-explorer-video {
        height: 220px;
    }
}

@media (max-width: 480px) {
    .reddit-explorer-wrapper {
        min-height: 100vh;
    }

    .reddit-explorer-metrics {
        grid-template-columns: 1fr;
    }

    .reddit-explorer-stats {
        grid-template-columns: 1fr;
    }

    .reddit-explorer-main {
        padding: 12px;
    }

    .reddit-explorer-search-box,
    .reddit-explorer-user-panel,
    .reddit-explorer-post {
        padding: 15px;
        border-radius: 15px;
    }

    .reddit-explorer-icon {
        width: 52px;
        height: 52px;
        font-size: 24px;
        border-radius: 16px;
    }

    .reddit-explorer-avatar {
        width: 52px;
        height: 52px;
        font-size: 1.7rem;
    }

    .reddit-explorer-description {
        font-size: 13px;
    }

    .reddit-explorer-section-heading {
        font-size: 1.2rem;
    }

    .reddit-explorer-post-title {
        font-size: 0.95rem;
    }

    .reddit-explorer-input,
    .reddit-explorer-button {
        font-size: 13px !important;
    }

    .reddit-explorer-progress-header,
    .reddit-explorer-progress-info {
        flex-direction: column;
        align-items: stretch;
    }

    .reddit-explorer-cancel {
        width: 100%;
    }

    .reddit-explorer-close {
        top: 14px;
        right: 18px;
        font-size: 36px;
    }
}

@media (max-width: 400px) {
    .reddit-explorer-main {
        padding: 10px;
    }

    .reddit-explorer-search-box,
    .reddit-explorer-user-panel,
    .reddit-explorer-post {
        padding: 12px;
    }

    .reddit-explorer-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .reddit-explorer-avatar {
        width: 48px;
        height: 48px;
        font-size: 1.55rem;
    }

    .reddit-explorer-description {
        font-size: 12px;
    }

    .reddit-explorer-section-heading {
        font-size: 1.1rem;
    }

    .reddit-explorer-post-title {
        font-size: 0.9rem;
    }

    .reddit-explorer-search-form {
        gap: 10px;
    }

    .reddit-explorer-button {
        padding: 13px 16px;
        min-width: 0;
    }
}

@media (max-width: 375px) {
    .reddit-explorer-main {
        padding: 8px;
    }

    .reddit-explorer-search-box,
    .reddit-explorer-user-panel,
    .reddit-explorer-post {
        padding: 10px;
    }

    .reddit-explorer-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .reddit-explorer-avatar {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    .reddit-explorer-description {
        font-size: 11px;
    }

    .reddit-explorer-section-heading {
        font-size: 1rem;
    }

    .reddit-explorer-post-title {
        font-size: 0.85rem;
    }

    .reddit-explorer-control,
    .reddit-explorer-external,
    .reddit-explorer-expand {
        font-size: 0.78rem;
    }
}