/* ============================================
   New Home Page Styles
   ============================================ */

.new-home-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f0f2f5;
}

/* ============================================
   Reels Section
   ============================================ */

.reels-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

.reels-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    color: #050505;
    margin: 0;
}

.reels-header h2 svg {
    color: #008000;
}

.see-all-link {
    color: #008000;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

.see-all-link:hover {
    color: #359020;
    text-decoration: underline;
}

/* Reels Carousel */
.reels-carousel-wrapper {
    position: relative;
}

.reels-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.reels-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.reel-item {
    flex: 0 0 160px;
    width: 160px;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f2f5;
    transition: transform 0.2s;
}

.reel-item:hover {
    transform: translateY(-4px);
}

.reel-item a {
    text-decoration: none;
    color: inherit;
}

.reel-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

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

.reel-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.reel-item:hover .reel-play-icon {
    background: rgba(0, 0, 0, 0.8);
}

.reel-info {
    padding: 12px;
}

.reel-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.reel-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.reel-author-name {
    font-size: 13px;
    font-weight: 600;
    color: #050505;
}

.reel-text {
    font-size: 12px;
    color: #65676b;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Navigation Buttons */
.reel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    z-index: 10;
}

.reel-nav:hover {
    background: #f0f2f5;
    transform: translateY(-50%) scale(1.1);
}

.reel-nav-left {
    left: -12px;
}

.reel-nav-right {
    right: -12px;
}

/* ============================================
   Content Wrapper (Posts + Sidebar)
   ============================================ */

.new-home-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
}

/* ============================================
   Posts Section
   ============================================ */

.posts-section {
    background: transparent;
    min-height: 100vh; /* Ensure enough height for scrolling */
}

.posts-header {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.posts-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    color: #050505;
    margin: 0;
}

.posts-header h2 svg {
    color: #008000;
}

.posts-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Load More Spinner */
.load-more-posts {
    padding: 20px 0;
}

.loader-spinner {
    text-align: center;
    padding: 20px;
}

.loader-spinner.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    border: 4px solid #f0f2f5;
    border-top: 4px solid #008000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader-spinner p {
    color: #65676b;
    font-size: 14px;
}

/* ============================================
   Login Sidebar (Desktop) - FIXED FOR STICKY
   ============================================ */

.login-sidebar {
    display: block;
    /* theiaStickySidebar will handle the positioning */
}

.login-prompt-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-prompt-icon {
    margin-bottom: 16px;
}

.login-prompt-icon svg {
    color: #008000;
}

.login-prompt-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #050505;
    margin: 0 0 8px;
}

.login-prompt-card p {
    font-size: 14px;
    color: #65676b;
    margin: 0 0 20px;
}

/* Login Form Styles */
.new-home-login-form {
    margin-bottom: 20px;
}

.new-home-login-form .wow_form_fields {
    margin-bottom: 12px;
    text-align: left;
}

.new-home-login-form .wow_form_fields label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #050505;
    margin-bottom: 6px;
}

.new-home-login-form .wow_form_fields input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
    color: #050505;
    background: #fff;
    transition: border-color 0.2s;
}

.new-home-login-form .wow_form_fields input:focus {
    outline: none;
    border-color: #008000;
}

.new-home-login-form .forgot_password {
    text-align: right;
    margin-bottom: 12px;
}

.new-home-login-form .forgot_password a {
    font-size: 13px;
    color: #008000;
    text-decoration: none;
}

.new-home-login-form .forgot_password a:hover {
    text-decoration: underline;
}

.new-home-login-form .alert {
    padding: 10px;
    border-radius: 6px;
    margin-top: 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.new-home-login-form .alert-danger {
    background-color: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.new-home-login-form .alert-success {
    background-color: #efe;
    color: #070;
    border: 1px solid #cfc;
}

.login-prompt-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background: #008000;
    color: #fff;
}

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

.btn-secondary {
    background: #e4e6eb;
    color: #050505;
}

.btn-secondary:hover {
    background: #d8dadf;
}

.btn-loading {
    opacity: 0.7;
    pointer-events: none;
}

.login-prompt-features {
    border-top: 1px solid #e4e6eb;
    padding-top: 20px;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #050505;
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-item svg {
    color: #359020;
    flex-shrink: 0;
}

/* ============================================
   Bottom Login Prompt (Mobile)
   ============================================ */

.login-prompt-bottom {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e4e6eb;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.login-prompt-bottom-content {
    max-width: 600px;
    margin: 0 auto;
}

.login-prompt-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    gap: 12px;
}

.login-prompt-toggle svg:first-child {
    color: #008000;
    flex-shrink: 0;
}

.login-prompt-bottom-text {
    flex: 1;
    text-align: left;
}

.login-prompt-bottom-text p {
    margin: 0;
    font-size: 15px;
    color: #050505;
}

.login-prompt-bottom-text span {
    font-size: 13px;
    color: #65676b;
}

.toggle-icon {
    color: #65676b;
    flex-shrink: 0;
    transition: transform 0.3s;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.login-prompt-bottom-form {
    padding: 0 16px 16px;
    border-top: 1px solid #e4e6eb;
    background: #f9fafb;
}

.login-prompt-bottom-form .new-home-login-form {
    margin-bottom: 0;
}

.login-prompt-bottom-form .wow_form_fields {
    margin-bottom: 10px;
}

.login-prompt-bottom-form .forgot_password {
    margin-bottom: 10px;
}

.login-prompt-bottom-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-bottom-signin,
.btn-bottom-signup {
    flex: 1;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-bottom-signin {
    background: #008000;
    color: #fff;
}

.btn-bottom-signin:hover {
    background: #359020;
}

.btn-bottom-signup {
    background: #e4e6eb;
    color: #050505;
}

.btn-bottom-signup:hover {
    background: #d8dadf;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (max-width: 992px) {
    .new-home-content-wrapper {
        grid-template-columns: 1fr 280px;
    }

    .reel-item {
        flex: 0 0 140px;
        width: 140px;
    }

    .reel-thumbnail {
        height: 180px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .new-home-page {
        padding: 12px;
        padding-bottom: 80px; /* Space for bottom login bar */
    }

    .new-home-content-wrapper {
        grid-template-columns: 1fr;
    }

    .login-sidebar {
        display: none !important; /* Hide sticky sidebar on mobile */
    }

    .login-prompt-bottom {
        display: block; /* Show bottom login bar on mobile */
    }

    .reels-section {
        padding: 16px 12px;
        border-radius: 8px;
    }

    .posts-header {
        padding: 12px 16px;
        border-radius: 8px;
    }

    .reel-item {
        flex: 0 0 120px;
        width: 120px;
    }

    .reel-thumbnail {
        height: 160px;
    }

    .reel-nav {
        width: 36px;
        height: 36px;
    }

    .reel-nav-left {
        left: -8px;
    }

    .reel-nav-right {
        right: -8px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .new-home-page {
        padding: 8px;
    }

    .reels-section,
    .posts-header {
        border-radius: 0;
        margin-left: -8px;
        margin-right: -8px;
    }

    .reel-item {
        flex: 0 0 110px;
        width: 110px;
    }

    .reel-thumbnail {
        height: 140px;
    }

    .login-prompt-toggle {
        flex-direction: row;
        align-items: center;
    }

    .login-prompt-bottom-text {
        text-align: left;
    }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .new-home-page {
        background-color: #18191a;
    }

    .reels-section,
    .posts-header,
    .login-prompt-card,
    .login-prompt-bottom {
        background: #242526;
        color: #e4e6eb;
    }

    .reels-header h2,
    .posts-header h2,
    .login-prompt-card h3,
    .reel-author-name,
    .feature-item {
        color: #e4e6eb;
    }

    .reel-text,
    .login-prompt-card p,
    .login-prompt-bottom-text span {
        color: #b0b3b8;
    }

    .reel-item {
        background: #3a3b3c;
    }

    .btn-secondary {
        background: #3a3b3c;
        color: #e4e6eb;
    }

    .btn-secondary:hover {
        background: #4e4f50;
    }

    .login-prompt-features {
        border-top-color: #3a3b3c;
    }

    .login-prompt-bottom {
        border-top-color: #3a3b3c;
    }
}