
/* Enhanced CSS Fixes for Instagram Reels Clone */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #000;
    color: #fff;
    overflow-x: hidden;
    line-height: 1.4;
}

/* Main Container */
.main-container {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(45deg, #000, #1a1a1a);
}

/* Video Container */
.video-container {
    width: 375px;
    height: 100vh;
    position: relative;
    border-radius: 0;
    overflow: hidden;
    background: #000;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

/* Video Element */
.video-element, video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* Sidebar (Right Side) */
.sidebar {
    position: absolute;
    right: 12px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

/* Action Button Base */
.action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.action-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* Icon Styles */
.icon {
    width: 24px;
    height: 24px;
    fill: #fff;
    stroke: #fff;
    stroke-width: 2;
}

/* Like Button */
.like-btn {
    background: rgba(255,20,60,0.8);
}

.like-btn.active {
    background: #ff1744;
    transform: scale(1.2);
}

/* Comment Button */
.comment-btn svg {
    transform: rotate(-90deg);
}

/* Share Button */
.share-btn svg {
    transform: rotate(15deg);
}

/* Count Text */
.count-text {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    margin-top: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* User Info Section */
.user-info {
    position: absolute;
    bottom: 20px;
    left: 12px;
    right: 80px;
    z-index: 10;
}

.user-info .username {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.user-info .description {
    font-size: 13px;
    line-height: 1.3;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Profile Picture */
.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-bottom: 12px;
    object-fit: cover;
}

/* Top Bar */
.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.top-bar .title {
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Bottom Navigation */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 10;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

.nav-item .icon {
    width: 20px;
    height: 20px;
}

.nav-item .label {
    font-size: 10px;
    opacity: 0.8;
}

/* Progress Bar */
.progress-bar {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.3);
    z-index: 10;
}

.progress-fill {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width 0.1s linear;
}

/* Loading Spinner */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 15;
}

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

/* Mobile Responsive */
@media (max-width: 480px) {
    .video-container {
        width: 100vw;
        border-radius: 0;
    }
    
    .main-container {
        padding: 0;
    }
}

/* Hover Effects */
.video-container:hover .sidebar {
    opacity: 1;
}

.video-container:hover .user-info {
    opacity: 1;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

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

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

/* Heart Animation */
.heart-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    color: #ff1744;
    animation: heartPop 0.6s ease-out;
    pointer-events: none;
    z-index: 20;
}

@keyframes heartPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Text Shadow for Better Readability */
.user-info *, .top-bar *, .bottom-nav * {
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

/* Fix for Broken Images */
img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* SVG Icon Fix */
svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Button Focus States */
.action-btn:focus,
.nav-item:focus {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: 2px;
}
