:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --primary-color: #f59e0b; /* Amber */
    --primary-hover: #d97706;
    --accent-color: #ef4444; /* Red for invalid/heart */
    --card-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    --font-primary: 'Inter', 'Noto Sans SC', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Glassmorphism Utilities */
.glass-effect {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.logo-icon {
    font-size: 2rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-select {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    padding: 0.5rem;
    border-radius: 8px;
    font-family: var(--font-primary);
    cursor: pointer;
    outline: none;
}

.lang-select option {
    background: var(--bg-color);
    color: var(--text-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info.hidden {
    display: none;
}

.points-badge {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-weight: 500;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

/* Buttons */
button {
    font-family: var(--font-primary);
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: #111;
    padding: 0.5rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-secondary:hover {
    color: var(--text-color);
}

.btn-accent {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    padding: 1rem 2rem;
    border-radius: 999px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-accent:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.full-width {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

/* Hero Section */
.hero {
    padding: 6rem 5%;
    text-align: center;
    position: relative;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #f8fafc, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Decorative Blobs */
.blob {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    border-radius: 50%;
    opacity: 0.4;
    animation: float 10s ease-in-out infinite;
}

.blob-1 {
    top: 10%;
    left: 20%;
    width: 300px;
    height: 300px;
    background: #f59e0b;
}

.blob-2 {
    bottom: -10%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: #ef4444;
    animation-delay: -5s;
}

/* Whiteboard Section */
.whiteboard-container {
    padding: 2rem 5%;
}

.whiteboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.filter-tabs {
    display: flex;
    gap: 1rem;
}

.tab {
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

/* Masonry Grid */
.masonry-grid {
    column-count: 1;
    column-gap: 1.5rem;
}

@media (min-width: 768px) {
    .masonry-grid { column-count: 2; }
}

@media (min-width: 1024px) {
    .masonry-grid { column-count: 3; }
}

@media (min-width: 1280px) {
    .masonry-grid { column-count: 4; }
}

/* Video Card */
.video-card {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.video-thumbnail {
    width: 100%;
    height: 200px;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon {
    position: absolute;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease;
}

.video-card:hover .play-icon {
    transform: scale(1.1);
    color: var(--primary-color);
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.card-content {
    padding: 1.25rem;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-platform {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
}

.action-btn {
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.action-btn:hover {
    color: var(--text-color);
}

.action-btn.active.like { color: var(--primary-color); }
.action-btn.active.fav { color: var(--accent-color); }

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    padding: 2rem;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
}

.close-btn:hover {
    color: var(--text-color);
}

.modal h2 {
    margin-bottom: 0.5rem;
    text-align: center;
}

.modal p {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Login specific */
.login-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.wechat-btn { background: #07c160; }
.wechat-btn:hover { background: #06ad56; }

.whatsapp-btn { background: #25d366; }
.whatsapp-btn:hover { background: #20bd5c; }

.mock-notice {
    margin-top: 1.5rem;
    color: #64748b !important;
}

/* Upload specific */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    font-family: var(--font-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.mock-algorithm-field {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
}

.mock-algorithm-field small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
}

.status-message {
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
    min-height: 1.2rem;
}

.status-message.error { color: var(--accent-color); }
.status-message.success { color: #10b981; }

/* Animations */
@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

.bounce-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(245, 158, 11, 0.7); }
    100% { transform: scale(1); }
}

.popup-animation {
    animation: popup 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popup {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}
