@charset "UTF-8";

:root {
    --primary: #165DFF;
    --secondary: #FF7D00;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-dark: rgba(30, 30, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

ul, ol {
    list-style: none;
}

/* Glassmorphism Base Styles */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
}

.glass-panel-dark {
    background: var(--glass-dark);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.glass-input {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.2);
    outline: none;
}

.glass-nav {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-card {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.12);
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.18);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.3) 25%, rgba(255,255,255,0.5) 50%, rgba(255,255,255,0.3) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-glass {
    background: linear-gradient(90deg, rgba(255,255,255,0.15) 25%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.15) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Basic Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

.slide-up {
    animation: slideUp 0.6s ease-out;
}

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

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(22, 93, 255, 0.3); }
    50% { box-shadow: 0 0 40px rgba(22, 93, 255, 0.6); }
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
}

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

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-container:hover .video-controls {
    opacity: 1;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #165DFF, #4D7FFF);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-bar:hover .progress-fill {
    background: linear-gradient(90deg, #165DFF, #7BA3FF);
}

.progress-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.progress-bar:hover .progress-thumb {
    opacity: 1;
}

/* Volume Slider */
.volume-slider {
    width: 0;
    transition: width 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    overflow: hidden;
}

.volume-container:hover .volume-slider {
    width: 80px;
    opacity: 1;
}

/* Speed Menu */
.speed-menu {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.speed-menu.active {
    opacity: 1;
    visibility: visible;
}

.speed-option {
    padding: 8px 24px;
    color: white;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}

.speed-option:hover {
    background: rgba(255,255,255,0.1);
}

.speed-option.active {
    color: #165DFF;
    background: rgba(22, 93, 255, 0.2);
}

/* Card Transitions */
.card-transition {
    transition: all 0.3s ease;
}

.content-auto {
    content-visibility: auto;
}

.text-balance {
    text-wrap: balance;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.modal-body {
    padding: 1.5rem;
}

.modal-close {
    color: white;
    font-size: 1.5rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    cursor: pointer;
}

.modal-close:hover {
    opacity: 1;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(40, 40, 40, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-left: 4px solid #22c55e;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.2);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    flex: 1;
    padding: 4px 8px;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-box button {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
}

.search-box button:hover {
    color: white;
}

/* Sort Select */
.sort-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.sort-select:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sort-select option {
    background: #1a1a1a;
    color: white;
}

/* Clear Filter Button */
.clear-filter-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-filter-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Post Card */
.post-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.post-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* Post Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Post Header */
.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.post-user-info {
    flex: 1;
    min-width: 0;
}

.post-username {
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Post Title */
.post-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Post Content */
.post-content {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Post Media Grid */
.post-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.post-media-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.post-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-media-item:hover img {
    transform: scale(1.05);
}

/* Media Unauthorized */
.media-unauthorized {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.875rem;
    text-align: center;
}

/* Post Stats */
.post-stats {
    display: flex;
    gap: 16px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: color 0.2s;
}

.post-stat-item:hover {
    color: white;
}

/* Post Actions */
.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    padding: 6px 12px;
    border-radius: 8px;
}

.post-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.post-action-btn.liked {
    color: #ff6b6b;
}

/* Load More Container */
.load-more-container {
    text-align: center;
    padding: 2rem 0;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #165DFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* No More Indicator */
.no-more-indicator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

/* Load Error Indicator */
.load-error-indicator {
    color: #fca5a5;
    text-align: center;
}

.load-error-indicator button {
    color: #165DFF;
    text-decoration: underline;
    cursor: pointer;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.5);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1.125rem;
}

/* Scroll Progress Bar */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #165DFF, #FF7D00);
    z-index: 9999;
    width: 0;
    transition: width 0.1s linear;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .post-media-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .post-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .post-stats {
        flex-wrap: wrap;
        gap: 12px;
    }
}
