/**
 * Custom Home Page Styles - Complete Design System
 */

/* Reset WordPress Defaults */
.wp-site-blocks,
.entry-content,
.wp-block-post-content {
    padding: 0 !important;
    margin: 0 !important;
}

.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    max-width: 100% !important;
    margin: 0 !important;
}

/* Hero Section - Fixed for CLS */
.hero-section {
    width: 100%;
    min-height: 600px;
    height: 600px; /* Fixed height to prevent CLS */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    position: relative;
    overflow: hidden;
    contain: layout; /* CSS containment for performance */
}

.hero-content {
    max-width: 800px;
    text-align: center;
    color: white;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0 0 20px 0;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-tagline {
    font-size: 1.3rem;
    margin: 0 0 40px 0;
    opacity: 0.95;
    font-weight: 400;
    line-height: 1.6;
}

/* Download Container */
.download-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin: 0 auto 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Download Form - Beautiful & Professional */
.download-form {
    margin-bottom: 25px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
}

.url-input {
    flex: 1;
    min-width: 350px;
    padding: 20px 28px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #2d3748;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.url-input:focus {
    border-color: rgba(255, 255, 255, 0.9);
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3), 0 0 0 4px rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.url-input::placeholder {
    color: #a0aec0;
    font-size: 15px;
}

.download-button {
    padding: 20px 45px;
    font-size: 17px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.3px;
}

.download-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #7c8ff0 0%, #8a5cb8 100%);
}

.download-button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.download-button svg {
    width: 20px;
    height: 20px;
}

/* Download Result Preview - OLD STYLES COMMENTED OUT FOR NEW VIEWER
.download-result {
    position: relative;
    display: none;
    margin-top: 24px;
    padding: 28px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 244, 255, 0.9));
    box-shadow: 0 18px 50px rgba(82, 95, 127, 0.18);
    border: 1px solid rgba(102, 126, 234, 0.22);
    gap: 28px;
    align-items: flex-start;
    overflow: hidden;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
}

.download-result::before {
    content: '';
    position: absolute;
    inset: -60% -10% auto -10%;
    height: 140%;
    background: radial-gradient(circle at top, rgba(102, 126, 234, 0.35), rgba(118, 75, 162, 0) 65%);
    opacity: 0.22;
    transition: opacity 0.4s ease;
}

.download-result > * {
    position: relative;
    z-index: 1;
}

.download-result.is-visible {
    display: flex;
    flex-wrap: wrap;
    opacity: 1;
    transform: translateY(0);
}

.download-result.is-visible::before {
    opacity: 0.28;
}
END OLD STYLES */

.download-result:hover {
    box-shadow: 0 22px 60px rgba(82, 95, 127, 0.22);
    border-color: rgba(102, 126, 234, 0.35);
}

.download-result:hover::before {
    opacity: 0.35;
}

.download-result-media {
    flex: 1 1 360px;
    max-width: 540px;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 16px 45px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.download-result-media::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    z-index: 0;
    pointer-events: none;
}

.download-result-media-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.download-result-media-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.03) 45%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 55%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    z-index: 0;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.download-result-media img,
.download-result-media video {
    animation: fadeInMedia 0.5s ease;
}

@keyframes fadeInMedia {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.download-result-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 1;
}

.download-result-media video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 1;
}

/* Custom Video Controls */
.download-result-media video::-webkit-media-controls-panel {
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
}

.download-result-media video::-webkit-media-controls-play-button,
.download-result-media video::-webkit-media-controls-current-time-display,
.download-result-media video::-webkit-media-controls-time-remaining-display {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Media Type Badge */
.media-type-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.media-type-badge svg {
    width: 16px;
    height: 16px;
}

.download-result-details {
    flex: 1 1 260px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.download-result-details h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-result-details h3::before {
    content: '✨';
    font-size: 1.3rem;
}

.download-result-meta {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #4b5563;
    font-size: 0.95rem;
}

.download-result-meta li {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.download-result-meta strong {
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
}

.download-result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.download-result-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4), 0 1px 3px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
}

.download-result-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.download-result-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.5), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.download-result-button:hover::before {
    opacity: 1;
}

.download-result-button:active {
    transform: translateY(-1px) scale(1);
    box-shadow: 0 8px 22px rgba(102, 126, 234, 0.4), 0 2px 5px rgba(0, 0, 0, 0.12);
}

.download-result-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
}

.download-result-button:hover .download-result-button-icon {
    transform: translateY(2px);
}

.download-result-button-icon svg {
    width: 22px;
    height: 22px;
    transition: transform 0.3s ease;
}

.download-result-button:hover .download-result-button-icon svg {
    animation: downloadBounce 0.6s ease infinite;
}

@keyframes downloadBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(3px);
    }
}

.download-result-button-label {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.download-result-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
    color: #334155;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-family: inherit;
    position: relative;
}

.download-result-secondary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.85);
}

.download-result-secondary-button:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
}

.download-result-secondary-button.is-success {
    background: rgba(16, 185, 129, 0.16);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}

.download-result-secondary-button.is-error {
    background: rgba(248, 113, 113, 0.18);
    color: #b91c1c;
    border-color: rgba(248, 113, 113, 0.35);
    box-shadow: 0 8px 18px rgba(248, 113, 113, 0.22);
}

.download-result-secondary-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28);
}

.download-result-secondary-button-icon svg {
    width: 18px;
    height: 18px;
}

.download-result-secondary-button-icon.is-success {
    background: rgba(16, 185, 129, 0.2);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.35);
}

.download-result-secondary-button-icon.is-error {
    background: rgba(248, 113, 113, 0.22);
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.35);
}

.download-result-secondary-button-label {
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.download-result-note {
    margin: 4px 0 0 0;
    font-size: 0.9rem;
    color: #475569;
    background: rgba(255, 255, 255, 0.65);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px dashed rgba(102, 126, 234, 0.35);
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.download-result-note strong {
    color: #3730a3;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .input-wrapper {
        flex-direction: column;
    }
    
    .url-input {
        min-width: 100%;
        width: 100%;
    }
    
    .download-button {
        width: 100%;
        justify-content: center;
        padding: 18px 30px;
    }

    .download-result {
        padding: 20px;
        flex-direction: column;
    }

    .download-result-media {
        max-width: 100%;
        flex: 1 1 100%;
    }

    .download-result-details {
        flex: 1 1 100%;
    }

    .download-result-actions {
        width: 100%;
        flex-direction: column;
    }

    .download-result-button,
    .download-result-secondary-button {
        width: 100%;
        justify-content: center;
    }

    .media-type-badge {
        top: 12px;
        right: 12px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .download-result-details h3 {
        font-size: 1.3rem;
    }
}

/* Format Tabs */
.format-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.format-tab {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    color: white;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.format-tab:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Trust Bar */
.trust-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 30px;
}

.trust-item {
    color: white;
    font-size: 0.95rem;
    padding: 8px 0;
    opacity: 0.9;
}

/* How Section */
.how-section {
    padding: 80px 20px;
    background: #f8f9fa;
}

.how-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 50px 0;
    color: #2d3748;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.step-card {
    background: white;
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 2rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.step-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #2d3748;
}

.step-card p {
    font-size: 1rem;
    color: #718096;
    line-height: 1.6;
    margin: 0;
}

/* Features Section */
.features-section {
    padding: 80px 20px;
    background: white;
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    text-align: center;
    padding: 40px 30px;
    background: #f8f9fa;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #2d3748;
}

.feature-card p {
    font-size: 1rem;
    color: #718096;
    line-height: 1.6;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-tagline {
        font-size: 1.1rem;
    }
    
    .url-form {
        flex-direction: column;
    }
    
    .url-input-field {
        min-width: 100%;
    }
    
    .download-button {
        width: 100%;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .steps-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .trust-bar {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        min-height: 500px;
        padding: 60px 15px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .download-container {
        padding: 20px;
    }
    
    .format-tabs {
        gap: 8px;
    }
    
    .format-tab {
        font-size: 0.85rem;
        padding: 8px 15px;
    }
}

/* Download Messages */
.download-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.download-message-error {
    background: #fee;
    border: 2px solid #f44;
    color: #c00;
}

.download-message-success {
    background: #efe;
    border: 2px solid #4c4;
    color: #060;
}

.download-message-info {
    background: #eef;
    border: 2px solid #44f;
    color: #006;
}

/* Loading Spinner */
.download-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Instagram Story Viewer (Inline) */
.instagram-story-viewer {
    max-width: 520px;
    margin: 40px auto;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Bar */
.story-progress-bar {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.story-progress-fill {
    height: 100%;
    width: 100%;
    background: #fff;
    transform-origin: left;
    animation: progress 5s linear forwards;
}

@keyframes progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* Header */
.story-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.story-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.story-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.story-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.story-username {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}

.story-timestamp {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

/* Story Content */
.story-content {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
    overflow: hidden;
}

.story-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-media-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
}

.story-media-badge svg {
    width: 16px;
    height: 16px;
}

/* Footer Controls */
.story-footer {
    padding: 24px 20px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.story-download-btn {
    flex: 1;
    max-width: 280px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.story-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
}

.story-download-btn svg {
    width: 22px;
    height: 22px;
}

.story-action-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.story-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.story-action-btn svg {
    width: 20px;
    height: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .instagram-story-viewer {
        margin: 24px 16px;
        border-radius: 20px;
    }

    .story-footer {
        padding: 20px 16px;
        flex-wrap: wrap;
    }

    .story-download-btn {
        font-size: 15px;
        padding: 14px 24px;
        max-width: 100%;
    }

    .story-action-btn {
        width: 48px;
        height: 48px;
    }
}
/* ==========================================
   CONTENT VIEWER STYLES v2.0
   Universal viewer for video, image, text
   ========================================== */

/* Base viewer container */
.content-viewer {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 600px;
    margin: 2rem auto;
    animation: slideUp 0.4s ease-out;
}

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

/* Header section */
.content-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.content-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    flex-shrink: 0;
}

.content-info {
    flex: 1;
    min-width: 0;
}

.content-username {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.content-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}

.content-meta .separator {
    color: #ccc;
}

.platform-name {
    text-transform: capitalize;
}

/* Media container */
.media-container {
    position: relative;
    background: #000;
    max-height: 600px;
}

.media-content {
    display: block;
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
}

.media-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.media-badge svg {
    width: 16px;
    height: 16px;
}

/* Caption section */
.content-caption {
    padding: 16px;
    line-height: 1.6;
    font-size: 15px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.content-caption.rtl {
    direction: rtl;
    text-align: right;
}

.caption-preview,
.caption-full {
    transition: all 0.3s ease;
}

.caption-full.hidden {
    display: none;
}

.caption-preview.hidden {
    display: none;
}

.read-more-btn {
    background: none;
    border: none;
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 8px;
    transition: color 0.2s;
}

.read-more-btn:hover {
    color: #5568d3;
}

.read-more-btn.hidden {
    display: none;
}

/* Text formatting */
.hashtag {
    color: #667eea;
    font-weight: 500;
}

.mention {
    color: #E4405F;
    font-weight: 500;
}

.content-link {
    color: #1DA1F2;
    text-decoration: none;
    border-bottom: 1px solid #1DA1F2;
    transition: opacity 0.2s;
}

.content-link:hover {
    opacity: 0.7;
}

/* Text viewer specific */
.text-card {
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
}

.text-card.rtl {
    direction: rtl;
    text-align: right;
}

.text-content {
    font-size: 16px;
    line-height: 1.8;
}

.text-card .hashtag {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

.text-card .mention {
    color: #ffd700;
}

.text-card .content-link {
    color: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

/* Actions section */
.content-actions {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #fafafa;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.action-btn.primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

/* Zoom modal */
.zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

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

.zoom-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-content img {
    display: block;
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
}

.zoom-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.zoom-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Download result container */
.download-result {
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.download-result.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Messages */
.download-message {
    padding: 16px 20px;
    border-radius: 12px;
    margin: 1rem 0;
    font-size: 15px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.download-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.download-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.download-message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading state */
.download-button.loading {
    position: relative;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .content-viewer {
        border-radius: 12px;
        margin: 1rem;
        max-width: 100%;
    }
    
    .content-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .media-container {
        max-height: 500px;
    }
    
    .media-content {
        max-height: 500px;
    }
}

@media (max-width: 480px) {
    .content-viewer {
        border-radius: 8px;
        margin: 0.5rem;
    }
    
    .content-header {
        padding: 12px;
    }
    
    .content-avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .content-caption {
        padding: 12px;
        font-size: 14px;
    }
    
    .text-card {
        padding: 16px;
    }
    
    .content-actions {
        padding: 12px;
        gap: 8px;
    }
    
    .action-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* RTL support improvements */
.rtl * {
    direction: rtl;
}

.rtl .content-header {
    flex-direction: row-reverse;
}

.rtl .content-meta {
    flex-direction: row-reverse;
}
