/* Main App Styles - TikTok-like Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #fe2c55;
    --secondary-color: #25f4ee;
    --bg-color: #000;
    --text-color: #fff;
    --sidebar-width: 240px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #121212;
    padding: 20px;
    overflow-y: auto;
    z-index: 100;
}

.logo h1 {
    font-size: 24px;
    margin-bottom: 30px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-item.active {
    background: var(--primary-color);
}

.sidebar-item .icon {
    font-size: 24px;
}

.sidebar-footer {
    margin-top: 30px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Video Container (TikTok-style) */
.video-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}

.video-item {
    position: relative;
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-item video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

.video-creator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.video-creator img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.video-actions {
    position: absolute;
    right: 20px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn span {
    font-size: 14px;
    margin-top: 5px;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #121212;
    padding: 10px 0;
    justify-content: space-around;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #888;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item .icon {
    font-size: 24px;
    margin-bottom: 3px;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #d41e42;
}

.btn-follow {
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Upload Container */
.upload-container {
    max-width: 600px;
    margin: 50px auto;
    padding: 30px;
    background: #1a1a1a;
    border-radius: 12px;
}

.upload-container h2 {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: white;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

/* Messages */
.messages-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    height: 100vh;
    background: #1a1a1a;
}

.conversations-list {
    border-right: 1px solid #2a2a2a;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.conversation-item:hover {
    background: #2a2a2a;
}

.conversation-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.chat-container {
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.message {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.message.sent {
    flex-direction: row-reverse;
}

.message-bubble {
    max-width: 60%;
    padding: 10px 15px;
    background: #2a2a2a;
    border-radius: 18px;
}

.message.sent .message-bubble {
    background: var(--primary-color);
}

.chat-input {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #2a2a2a;
}

.chat-input input {
    flex: 1;
    padding: 12px;
    background: #2a2a2a;
    border: none;
    border-radius: 20px;
    color: white;
}

.chat-input button {
    padding: 12px 24px;
    background: var(--primary-color);
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
}

/* Store */
.store-container {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.product-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

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

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.product-price {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: bold;
}

/* Profile */
.profile-container {
    max-width: 935px;
    margin: 0 auto;
    padding: 30px;
}

.profile-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 50px;
    margin-bottom: 40px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
}

.profile-stats {
    display: flex;
    gap: 40px;
    margin: 20px 0;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
}

.stat-label {
    color: #888;
}

.user-videos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.user-video {
    aspect-ratio: 9/16;
    background: #1a1a1a;
    cursor: pointer;
    overflow: hidden;
}

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

/* Modals */
.video-modal,
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.video-modal.active,
.login-modal.active {
    display: flex;
}

.video-modal-content,
.login-modal-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 12px;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.login-tabs .tab {
    flex: 1;
    padding: 12px;
    background: #2a2a2a;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 8px;
}

.login-tabs .tab.active {
    background: var(--primary-color);
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.oauth-buttons button {
    padding: 12px;
    background: #2a2a2a;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

/* Search */
.search-container {
    max-width: 600px;
    margin: 30px auto;
    display: flex;
    gap: 10px;
}

.search-container input {
    flex: 1;
    padding: 15px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 25px;
    color: white;
    font-size: 16px;
}

.search-results {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        margin-bottom: 60px;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .messages-container {
        grid-template-columns: 1fr;
    }
    
    .conversations-list {
        display: none;
    }
    
    .user-videos {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 50px;
}

.spinner {
    border: 4px solid #2a2a2a;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Playlist Styles */
.playlists-container {
    padding: 20px;
}

.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.playlist-card {
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.playlist-card:hover {
    transform: translateY(-5px);
}

.playlist-thumbnail {
    position: relative;
    width: 100%;
    height: 150px;
    background: #2a2a2a;
}

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

.playlist-thumbnail .video-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
}

.playlist-card h3 {
    padding: 15px;
    font-size: 16px;
}

.playlist-card p {
    padding: 0 15px 15px;
    font-size: 14px;
    color: #aaa;
}

.playlist-card button {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

/* Calendar Styles */
.calendar-container {
    padding: 20px;
}

.calendar-view {
    margin-top: 20px;
}

.event-card {
    background: #1a1a1a;
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.event-type {
    background: var(--secondary-color);
    color: #000;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.event-date {
    color: #aaa;
    font-size: 14px;
    margin: 5px 0;
}

.event-creator {
    color: var(--primary-color);
    font-size: 14px;
}

/* Creator-only elements */
.creator-only {
    display: none;
}

body.is-creator .creator-only {
    display: block;
}

body.is-creator .sidebar-item.creator-only {
    display: flex;
}

/* Button styles */
.btn-secondary {
    background: #2a2a2a;
    color: white;
    border: 1px solid #444;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #3a3a3a;
}

/* Notification styles */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* PWA Install Prompt */
.pwa-prompt {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 350px;
    animation: slideIn 0.3s ease-out;
}

.pwa-prompt-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
}

.pwa-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.3);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

.pwa-prompt h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.pwa-prompt p {
    margin: 0 0 15px 0;
    opacity: 0.9;
}

.pwa-prompt button {
    margin-right: 10px;
    margin-top: 10px;
}

/* Resume Watching Notification */
.resume-notification {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    z-index: 1000;
    display: flex;
    gap: 10px;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

.resume-notification p {
    margin: 0;
    font-size: 14px;
}

.resume-notification button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.resume-notification button:first-of-type {
    background: var(--primary-color);
    color: white;
}

.resume-notification button:last-of-type {
    background: transparent;
    color: white;
    border: 1px solid white;
}

/* CSS Variables for theming */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-tertiary: #888888;
    --border-color: #333333;
    --primary-color: #fe2c55;
    --primary-hover: #ff4066;
    --success-color: #11998e;
    --warning-color: #fa709a;
    --error-color: #ff4444;
    --info-color: #4facfe;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .pwa-prompt {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .resume-notification {
        left: 10px;
        right: 10px;
        transform: none;
        flex-direction: column;
    }
}
