/* Quotes Bytes - Instagram-like quotes reels styling */

/* Main container */
.quotes-bytes-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    /* Updated to match main.css colors */
    background: var(--color-background);
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E"),
    var(--color-background);
    position: relative;
}

/* Header styling */
.quotes-bytes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--color-border);
    z-index: 10;
    background-color: var(--color-surface);
    backdrop-filter: blur(15px);
    box-shadow: var(--shadow-md);
}

.quotes-bytes-logo {
    font-weight: 700;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    letter-spacing: -0.5px;
    color: var(--color-primary);
    display: inline-block;
    position: relative;
    padding: var(--space-1) 0;
}

.quotes-bytes-logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.quotes-bytes-logo:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.quotes-bytes-actions {
    display: flex;
    gap: var(--space-3);
}

/* Button styles */
.auth-button {
    background-color: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
    background-color: var(--color-surface-raised);
}

.auth-button:hover {
    background: var(--color-primary-transparent);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Feed styling */
.quotes-bytes-feed {
    flex: 1;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    position: relative;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding: var(--space-2) 0;
}

.quotes-bytes-feed::-webkit-scrollbar {
    display: none;
}

/* Quote card styling - Enhanced with depth and glow */
.quote-card {
    height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-5);
    scroll-snap-align: center;
    position: relative;
    overflow: hidden;
    background: var(--color-surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    margin: var(--space-4) var(--space-4) 0 var(--space-4);
    transition: var(--transition-normal);
    border: 1px solid var(--color-border);
}

.quote-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

.quote-card:hover {
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(0, 173, 181, 0.1) inset;
    transform: translateY(-8px) scale(1.01);
    border-color: var(--color-primary);
}

.quote-card:last-child {
    margin-bottom: var(--space-4);
}

/* Quote header styling - Updated to position at bottom */
.quote-header {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(to top, var(--color-surface), transparent);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    display: flex;
    justify-content: flex-start;
    z-index: 3;
}

.quote-category {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 5px 12px;
    border-radius: var(--border-radius-pill);
    border: 1px solid var(--color-primary-transparent);
    background-color: var(--color-surface-raised);
}

.quote-content {
    position: relative;
    width: 100%;
    text-align: center;
    padding: var(--space-6) var(--space-5) var(--space-5);
}

.quote-marks {
    font-size: 8rem;
    opacity: 0.08;
    position: absolute;
    top: -4.5rem;
    left: 0;
    color: var(--color-primary);
    user-select: none;
    font-family: 'Georgia', serif;
}

/* Smooth fade-in for quotes */
.quote-text {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.5;
    font-weight: 500;
    margin-bottom: var(--space-5);
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
}

.quote-author {
    font-style: italic;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: var(--color-text-tertiary);
    position: relative;
    z-index: 2;
    letter-spacing: 0.05em;
    font-weight: 400;
    padding-top: var(--space-2);
    position: relative;
}

.quote-author::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
}

.like-button.liked {
    color: var(--color-error);
    text-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

#refreshQuotes {
    transition: var(--transition-normal);
}

#refreshQuotes .icon-text {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

#refreshQuotes:hover .icon-text {
    transform: rotate(180deg);
}

#refreshQuotes.refreshing {
    background: var(--color-primary-transparent);
}

/* Loading state */
.quotes-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--color-text-secondary);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    margin-bottom: var(--space-4);
    position: relative;
}

.loading-spinner::before,
.loading-spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: pulseRing 2s linear infinite;
}

.loading-spinner::before {
    border: 3px solid rgba(0, 173, 181, 0.1);
}

.loading-spinner::after {
    border: 3px solid transparent;
    border-top-color: var(--color-primary);
    animation: spin 1s linear infinite;
}

@keyframes pulseRing {
    0% { transform: scale(0.6); opacity: 0.6; }
    50% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(0.6); opacity: 0.6; }
}

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

.error-message, .no-quotes {
    text-align: center;
    padding: var(--space-5);
    color: var(--color-text-secondary);
    background: var(--color-surface-raised);
    border-radius: var(--border-radius-md);
    margin: var(--space-5);
    backdrop-filter: blur(5px);
    border: 1px solid var(--color-border);
}

/* Responsive styles */
@media (max-width: 768px) {
    .quote-card {
        height: calc(100vh - 120px);
        padding: var(--space-4) var(--space-3); /* Reduced padding for mobile */
        overflow-y: auto; /* Allow scrolling for exceptionally long quotes */
    }

    .quotes-bytes-feed .quote-card:first-child {
        margin-top: 0; /* Reduce top margin for the first card */
    }

    .quote-actions {
        gap: var(--space-3);
    }
    
    /* Optimize quote content for mobile */
    .quote-content {
        padding: var(--space-4) var(--space-2) var(--space-3); /* Reduced padding */
    }
    
    /* Smaller quote marks on mobile */
    .quote-marks {
        font-size: 6rem;
        top: -3.5rem;
        opacity: 0.06;
    }
    
    /* Adaptive text sizing for mobile */
    .quote-text {
        font-size: clamp(1.2rem, 5vw, 1.8rem); /* Smaller font size range */
        line-height: 1.4;
        margin-bottom: var(--space-3);
    }
    
    .quote-author {
        font-size: clamp(0.9rem, 4vw, 1.1rem);
    }
    
    /* Fix category positioning for mobile */
    .quote-header {
        padding: var(--space-2) var(--space-3);
    }
    
    .quote-category {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
}

/* Desktop layout enhancements */
@media (min-width: 769px) {
    .quotes-bytes-container {
        max-width: 100%;
        margin: 0;
        border-left: none;
        border-right: none;
        background: var(--color-background);
    }
    
    /* Enhanced header for desktop */
    .quotes-bytes-header {
        padding: var(--space-4) var(--space-6);
        width: 100%;
        max-width: none;
        margin: 0;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        background-color: var(--color-surface);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        display: flex;
        justify-content: space-between;
    }
    
    .quotes-bytes-header::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        width: 100%;
        height: 1px;
        background: linear-gradient(90deg, 
            transparent, 
            var(--color-primary-transparent), 
            var(--color-primary-transparent), 
            transparent);
    }
    
    .quotes-bytes-header > div {
        width: 1200px;
        max-width: 90%;
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .quotes-bytes-logo {
        font-size: 2rem;
        letter-spacing: -1px;
    }
    
    .auth-button {
        padding: 10px 24px;
        font-size: 15px;
        border-radius: var(--border-radius-md);
        transition: var(--transition-normal);
    }
    
    .auth-button:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
        background: var(--color-primary-transparent);
    }
    
    /* Immersive feed layout for desktop - FIXED to show only ONE quote at a time */
    .quotes-bytes-feed {
        padding: 0;
        margin-top: 100px; /* Increased space for fixed header from 80px */
        height: calc(100vh - 180px); /* Adjusted for header and footer from 160px */
        max-width: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        scroll-snap-type: y mandatory;
        scroll-behavior: smooth;
        display: block;
    }
    
    /* Enhanced quote card for desktop - REDUCED SIZE for better reading experience */
    .quote-card {
        width: 800px;
        max-width: 80%;
        min-height: auto; 
        height: auto;
        max-height: calc(100vh - 280px); /* Increased gap from 240px */
        margin: 40px auto; /* Increased from 0 auto */
        padding: var(--space-5) var(--space-5);
        border-radius: var(--border-radius-xl);
        box-shadow: var(--shadow-lg);
        background: linear-gradient(145deg, #1c1c24 0%, #262631 100%); /* New gradient background */
        border: 1px solid var(--color-border);
        position: relative;
        overflow: auto;
        scroll-snap-align: center;
        scroll-snap-stop: always;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    /* Larger quote text for desktop - Adjusted for smaller card */
    .quote-content {
        max-width: 90%; /* Adjusted from 800px to be proportional */
        margin: 0 auto;
        padding: var(--space-4) 0; /* Reduced padding */
    }
    
    /* Enhanced share action button - Adjusted position for smaller card */
    .quote-actions {
        position: absolute;
        right: var(--space-4); /* Reduced from var(--space-6) */
        top: var(--space-4);
    }
    
    /* Force sufficient spacing between cards to prevent multiple cards being visible */
    .quotes-bytes-feed .quote-card {
        margin-bottom: 100vh; /* Add full viewport height spacing between cards */
    }
    
    .quotes-bytes-feed .quote-card:last-child {
        margin-bottom: 20px; /* Less margin for last card */
    }
    
    /* Larger quote text for desktop - UPDATED for better scaling */
    .quote-content {
        max-width: 800px;
        margin: 0 auto;
        padding: var(--space-5) 0;
    }
    
    .quote-marks {
        font-size: 10rem;
        top: -5rem;
        left: -1.5rem;
        opacity: 0.06;
    }
    
    .quote-text {
        font-size: clamp(2rem, 3vw, 2.8rem);
        line-height: 1.4;
        margin-bottom: var(--space-4);
    }
    
    .quote-author {
        font-size: clamp(1.2rem, 1.5vw, 1.4rem);
    }
    
    .quote-author::before {
        width: 60px;
    }
    
    /* Refined position for the category tag */
    .quote-header {
        padding: var(--space-4) var(--space-6);
    }
    
    .quote-category {
        font-size: 1rem;
        padding: 6px 16px;
    }
    
    /* Enhanced share action button */
    .quote-actions {
        position: absolute;
        right: var(--space-6);
        top: var(--space-6);
        background: var(--color-surface-raised);
        border: 1px solid var(--color-border);
        border-radius: 50%;
        padding: 6px;
        backdrop-filter: blur(5px);
        z-index: 5;
    }
    
    .quote-action {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--color-primary-transparent);
    }
    
    .quote-action:hover {
        background: var(--color-primary-transparent-hover);
    }
    
    /* Fixed bottom controls bar */
    .quotes-bytes-controls {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: var(--space-4);
        max-width: none;
        background-color: var(--color-surface);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--color-border);
        z-index: 90;
        display: flex;
        justify-content: center;
    }
    
    .quotes-bytes-button {
        padding: var(--space-3) var(--space-6);
        font-size: 1.1rem;
        border-radius: var(--border-radius-md);
        transition: var(--transition-normal);
    }
    
    .quotes-bytes-button:hover {
        transform: translateY(-5px);
    }
    
    /* Fix for loading spinner position */
    .quotes-loading {
        padding: var(--space-8);
        margin-top: 0;
        height: calc(100vh - 160px);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Error message styling improvement */
    .error-message, .no-quotes {
        max-width: 600px;
        margin: 120px auto var(--space-5);
        padding: var(--space-6);
        border-radius: var(--border-radius-md);
        font-size: 1.2rem;
    }
}

/* Large desktop screens */
@media (min-width: 1440px) {
    .quote-card {
        width: 900px; /* Reduced from 1000px */
        max-height: calc(100vh - 260px); /* Reduced height */
        padding: var(--space-6); /* Adjusted padding for better proportions */
    }
    
    .quote-text {
        font-size: 2.8rem;
    }
    
    .quote-marks {
        font-size: 12rem;
        top: -6rem;
    }
}
