* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #000;
    color: white;
    overflow: hidden;
    height: 100vh;
}

.app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 15px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.profile-icon, .settings-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-icon:hover, .settings-icon:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.search-bar {
    flex: 1;
    margin: 0 15px;
    padding: 8px 15px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 16px;
    backdrop-filter: blur(10px);
}

.search-bar::placeholder {
    color: rgba(255,255,255,0.7);
}

/* Stories Section */
.stories-container {
    display: flex;
    gap: 12px;
    padding: 0 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overflow-x: auto;
    overflow: visible;
}

.stories-container::-webkit-scrollbar {
    display: none;
}

.story-item {
    flex-shrink: 0;
    text-align: center;
    cursor: pointer;
}

.story-circle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24);
    padding: 3px;
    margin-bottom: 5px;
    transition: transform 0.3s ease;
}

.story-circle:hover {
    transform: scale(1.1);
}

.story-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
    overflow: hidden;
}

.story-label {
    font-size: 12px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Main View */
.main-view {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 120px;
    height: calc(100vh - 120px);
}
.main-view > .tab {
    display: none;
    position: relative;
}
.main-view > .tab.active {
    box-sizing: border-box;
    display: block;
    height: 100%;
    width: 100%;
    padding: 10px;
}

/* Bottom Controls */
.bottom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 20px;
    background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.side-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.side-button:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

#vote-controls {
    display: flex;
    gap: 10px;
}

#like-button:after, #dislike-button:after, #share-button:after {
    content: " ";
    height: 100%;
    width: 100%;
    position: absolute;
    left: 0;
    top: 0;
    background-image: url(/media/icons/thumb-icon.jpg);
    background-size: 50% 50%;
    background-position: center;
    background-repeat: no-repeat;
    filter: invert(100%);
}
#dislike-button:after {
    transform: rotate(180deg);
}
#share-button:after {
    background-image: url(/media/icons/share.png);
}

/* Bottom Navigation */
.bottom-nav {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.nav-item {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-item.active {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 10px 15px;
    }
    
    .search-bar {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .story-circle {
        width: 55px;
        height: 55px;
    }
    
    .bottom-nav {
        gap: 20px;
    }
    
    .nav-item {
        font-size: 12px;
        padding: 8px 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.story-item {
    animation: fadeIn 0.5s ease forwards;
}

.story-item:nth-child(1) { animation-delay: 0.1s; }
.story-item:nth-child(2) { animation-delay: 0.2s; }
.story-item:nth-child(3) { animation-delay: 0.3s; }
.story-item:nth-child(4) { animation-delay: 0.4s; }
.story-item:nth-child(5) { animation-delay: 0.5s; }

/* Feed/Home */
#home {
    background: #000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.feed-controls.next, .feed-controls.previous {
    position: absolute;
    height: 100%;
    width: 30%;
}
.feed-controls.previous {
    left: 0;
    top: 0;
}
.feed-controls.next {
    right: 0;
    top: 0;
}
#media-viewport {
    height: 90%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.homemedia {
    display: block;
    max-height: 90%;
    max-width: 100%;
    position: relative;
    user-select: none;
}
#media-viewport:has(.homemedia.paused):after {
    content: " ";
    display: block;
    width: 100px;
    height: 100px;
    position: absolute;
    left: calc(50% - 50px);
    top: calc(50% - 50px);
    background-image: url(/media/icons/play.png);
    background-size: auto 100%;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    user-select: none;
}
