/* stories.css - Lala Builders & Decor - Premium Stories Section */

/* ============================================
   STORIES SECTION - HOMEPAGE
   ============================================ */

.stories-section {
    padding: 50px 0 30px 0;
    background: var(--white);
    position: relative;
}

.stories-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.stories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.stories-header h2 {
    font-size: 2rem;
    font-weight: 700;
}

.stories-header h2 .gold-text {
    color: var(--gold);
}

.view-all-stories {
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-all-stories:hover {
    color: var(--gold-dark);
    transform: translateX(5px);
}

/* Stories Container */
.stories-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 5px 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.stories-container::-webkit-scrollbar {
    height: 4px;
}

.stories-container::-webkit-scrollbar-track {
    background: var(--off-white);
    border-radius: 10px;
}

.stories-container::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 10px;
}

/* ============================================
   STORY CARDS - RECTANGLE
   ============================================ */

.story-card {
    flex: 0 0 130px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.story-card:hover {
    transform: translateY(-8px);
}

.story-avatar {
    position: relative;
    width: 130px;
    height: 175px;
    margin: 0 auto 10px;
    border-radius: 18px;
    overflow: hidden;
    background: #1a1a1a;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.story-ring {
    width: 100%;
    height: 100%;
    padding: 3px;
    background: linear-gradient(135deg, #e2c27a, #c8a951, #a17f3a, #c8a951);
    background-size: 300% 300%;
    animation: shimmerRing 3s ease-in-out infinite;
    border-radius: 18px;
    position: relative;
}

@keyframes shimmerRing {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.story-ring img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    transition: transform 0.5s ease;
    display: block;
}

.story-card:hover .story-ring img {
    transform: scale(1.05);
}

/* Glow Effect */
.story-glow {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 20px;
    background: radial-gradient(circle, rgba(200,169,81,0.3), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.story-card:hover .story-glow {
    opacity: 1;
}

/* Play Badge */
.story-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 2px 15px rgba(0,0,0,0.3);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.story-card:hover .story-badge {
    opacity: 1;
    transform: scale(1);
}

.story-badge i {
    font-size: 11px;
    color: var(--black);
    margin-left: 2px;
}

/* Story Title Overlay */
.story-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 35px 10px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    border-radius: 0 0 16px 16px;
}

.story-title-overlay span {
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
    margin-top: 6px;
}

.story-card:hover .story-name {
    color: var(--gold);
}

/* No Stories */
.no-stories {
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

.no-stories i {
    font-size: 4rem;
    color: var(--gold);
    margin-bottom: 15px;
    display: block;
    opacity: 0.5;
}

.no-stories p {
    font-size: 1rem;
}

/* ============================================
   STORY VIEWER - PREMIUM POPUP
   ============================================ */

.story-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.88);
    backdrop-filter: blur(20px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.story-viewer.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.story-viewer-content {
    position: relative;
    max-width: 580px;
    width: 100%;
    max-height: 90vh;
    background: #0a0a0a;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.9);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Progress Bars */
.story-progress-container {
    position: absolute;
    top: 15px;
    left: 20px;
    right: 20px;
    display: flex;
    gap: 6px;
    z-index: 20;
}

.story-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 4px;
    overflow: hidden;
}

.story-progress-bar .progress-fill {
    height: 100%;
    background: var(--gold);
    width: 0%;
    transition: width 0.1s linear;
}

.story-progress-bar.active .progress-fill {
    animation: progressAnimation 5s linear forwards;
}

@keyframes progressAnimation {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Story Image */
.story-viewer-image {
    width: 100%;
    height: auto;
    max-height: 75vh;
    min-height: 400px;
    object-fit: contain;
    display: block;
    background: #0a0a0a;
}

/* Story Info Overlay */
.story-viewer-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 30px 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.95), rgba(0,0,0,0.7) 40%, transparent 100%);
    color: white;
    z-index: 10;
}

.story-viewer-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--gold);
    letter-spacing: -0.5px;
}

.story-viewer-description {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 15px;
    line-height: 1.6;
    font-weight: 400;
}

.story-viewer-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--black);
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(200,169,81,0.3);
}

.story-viewer-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(200,169,81,0.4);
}

.story-viewer-button i {
    font-size: 0.9rem;
}

/* ============================================
   NAVIGATION ARROWS - INSIDE POPUP
   ============================================ */

.story-viewer-prev,
.story-viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 15;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    visibility: hidden;
}

.story-viewer:hover .story-viewer-prev,
.story-viewer:hover .story-viewer-next {
    opacity: 1;
    visibility: visible;
}

.story-viewer-prev {
    left: 16px;
}

.story-viewer-next {
    right: 16px;
}

.story-viewer-prev:hover,
.story-viewer-next:hover {
    background: var(--gold);
    color: var(--black);
    border-color: var(--gold);
    transform: translateY(-50%) scale(1.08);
}

/* ============================================
   CLOSE BUTTON
   ============================================ */

.story-viewer-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 20;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-viewer-close:hover {
    background: var(--gold);
    color: var(--black);
    transform: rotate(90deg);
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 992px) {
    .story-card {
        flex: 0 0 110px;
    }
    
    .story-avatar {
        width: 110px;
        height: 150px;
    }
    
    .story-name {
        max-width: 110px;
    }
    
    .story-viewer-content {
        max-width: 90%;
    }
    
    .story-viewer-prev,
    .story-viewer-next {
        width: 42px;
        height: 42px;
        font-size: 16px;
        opacity: 0.8;
        visibility: visible;
    }
    
    .story-viewer-prev {
        left: 12px;
    }
    
    .story-viewer-next {
        right: 12px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .stories-section {
        padding: 30px 0 15px 0;
    }
    
    .stories-header h2 {
        font-size: 1.5rem;
    }
    
    .story-card {
        flex: 0 0 90px;
    }
    
    .story-avatar {
        width: 90px;
        height: 125px;
        border-radius: 14px;
    }
    
    .story-ring {
        border-radius: 14px;
    }
    
    .story-ring img {
        border-radius: 12px;
    }
    
    .story-name {
        font-size: 0.7rem;
        max-width: 90px;
    }
    
    .story-badge {
        width: 24px;
        height: 24px;
        bottom: 8px;
        right: 8px;
    }
    
    .story-badge i {
        font-size: 9px;
    }
    
    .story-title-overlay span {
        font-size: 0.7rem;
    }
    
    /* Story Viewer Mobile */
    .story-viewer {
        padding: 12px;
    }
    
    .story-viewer-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .story-viewer-image {
        max-height: 65vh;
        min-height: 350px;
        object-fit: cover;
    }
    
    .story-viewer-info {
        padding: 50px 20px 20px;
    }
    
    .story-viewer-title {
        font-size: 1.3rem;
    }
    
    .story-viewer-description {
        font-size: 0.9rem;
    }
    
    .story-viewer-button {
        padding: 10px 22px;
        font-size: 0.85rem;
    }
    
    .story-viewer-prev,
    .story-viewer-next {
        width: 38px;
        height: 38px;
        font-size: 15px;
        opacity: 0.9;
        visibility: visible;
    }
    
    .story-viewer-prev {
        left: 10px;
    }
    
    .story-viewer-next {
        right: 10px;
    }
    
    .story-viewer-close {
        width: 36px;
        height: 36px;
        font-size: 18px;
        top: 12px;
        right: 12px;
    }
    
    .story-progress-container {
        top: 12px;
        left: 15px;
        right: 15px;
        gap: 5px;
    }
    
    .story-progress-bar {
        height: 3px;
    }
}

@media (max-width: 480px) {
    .story-card {
        flex: 0 0 75px;
    }
    
    .story-avatar {
        width: 75px;
        height: 105px;
        border-radius: 12px;
    }
    
    .story-ring {
        border-radius: 12px;
        padding: 2px;
    }
    
    .story-ring img {
        border-radius: 10px;
    }
    
    .story-name {
        font-size: 0.6rem;
        max-width: 75px;
    }
    
    .story-badge {
        width: 20px;
        height: 20px;
        bottom: 6px;
        right: 6px;
    }
    
    .story-badge i {
        font-size: 8px;
    }
    
    .story-title-overlay span {
        font-size: 0.6rem;
    }
    
    /* Story Viewer Mobile Small */
    .story-viewer {
        padding: 8px;
    }
    
    .story-viewer-content {
        border-radius: 12px;
        max-height: 98vh;
    }
    
    .story-viewer-image {
        max-height: 60vh;
        min-height: 280px;
    }
    
    .story-viewer-info {
        padding: 40px 15px 15px;
    }
    
    .story-viewer-title {
        font-size: 1.1rem;
    }
    
    .story-viewer-description {
        font-size: 0.8rem;
    }
    
    .story-viewer-button {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .story-viewer-prev,
    .story-viewer-next {
        width: 32px;
        height: 32px;
        font-size: 12px;
        opacity: 0.9;
        visibility: visible;
    }
    
    .story-viewer-prev {
        left: 5px;
    }
    
    .story-viewer-next {
        right: 5px;
    }
    
    .story-viewer-close {
        width: 30px;
        height: 30px;
        font-size: 14px;
        top: 8px;
        right: 8px;
    }
    
    .story-progress-container {
        top: 8px;
        left: 12px;
        right: 12px;
        gap: 4px;
    }
    
    .story-progress-bar {
        height: 2px;
    }
}

/* ============================================
   ADD STORY CARD (if needed)
   ============================================ */

.story-card.add-story .story-ring {
    border-style: dashed;
    border-color: var(--gray);
    background: var(--off-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-card.add-story .story-ring i {
    font-size: 30px;
    color: var(--gray);
}

.story-card.add-story .story-ring img {
    display: none;
}