/* Main Layout Grid */
.main-layout-grid {
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    gap: 30px;
    align-items: start;
    margin-top: 30px;
    margin-bottom: 50px;
}

.sidebar-left,
.sidebar-right {
    position: sticky;
    top: 90px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

.feed-center {
    width: 100%;
    min-width: 0;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Responsive Breakpoints */
@media (max-width: 1200px) {
    .main-layout-grid {
        grid-template-columns: 220px 1fr 280px;
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .main-layout-grid {
        display: flex;
        flex-direction: column;
    }

    .sidebar-left,
    .sidebar-right {
        display: none;
    }
}

/* Survey Feed Styles */
.survey-feed {
    width: 100%;
}

@media (max-width: 768px) {
    .survey-feed {
        margin: 10px auto;
        gap: 15px;
        padding: 0 5px !important;
    }

    .page-header h1 {
        font-size: 1.8rem !important;
    }

    .page-header p {
        font-size: 1rem !important;
    }

    .feed-header {
        padding: 20px 20px 10px 20px !important;
    }

    .feed-content {
        padding: 0 20px 25px 20px !important;
    }

    .card-footer {
        padding: 15px 20px !important;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
    }

    .btn-embed {
        font-size: 0.8rem !important;
        padding: 6px 12px !important;
    }
}

.survey-feed-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    position: relative;
}

.survey-feed-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary) 0%, #a855f7 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.survey-feed-card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

.survey-feed-card:hover::before {
    opacity: 1;
}

.feed-header {
    padding: 30px 30px 20px 30px;
}

.feed-title-link h2 {
    font-size: 1.6rem;
    margin: 0 0 10px 0;
}

.feed-content {
    padding: 0 30px 30px 30px;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

/* Image Poll Grid */
.image-poll-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
}

.poll-image-container {
    height: 140px;
    width: 100%;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #f1f5f9;
}

.poll-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 480px) {
    .poll-image-container {
        height: 140px;
    }
}

.option-card {
    position: relative;
    background: #f8fafc;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    overflow: hidden;
    z-index: 1;
    min-height: 48px;
}

.option-card:hover {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
    transform: none;
    z-index: 2;
}

.option-content {
    font-weight: 500;
    color: #334155;
    font-size: 0.95rem;
    z-index: 2;
    position: relative;
}

.option-check {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
    position: relative;
    background: white;
}

.result-card-mode {
    cursor: default !important;
    background: #f1f5f9 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    padding: 10px 16px !important;
}

.result-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.25) 50%, rgba(99, 102, 241, 0.1) 100%);
    background-size: 200% 100%;
    animation: liquidFlow 3s infinite linear;
    width: 0%;
    z-index: 0;
    border-radius: 12px;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-percent-badge {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
    z-index: 2;
    position: relative;
}

.card-footer {
    padding: 15px 35px;
    background: white;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voted-badge {
    background: #ecfdf5;
    color: #059669;
    padding: 12px 20px;
    border-radius: 99px;
    gap: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f1f5f9;
    color: #ef4444;
}

.modal-body {
    padding: 25px;
}

.modal-body p {
    color: #64748b;
    margin-bottom: 15px;
    line-height: 1.5;
}

.code-area {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
}

.code-area textarea {
    width: 100%;
    height: 80px;
    background: transparent;
    border: none;
    resize: none;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    color: #334155;
    outline: none;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.action-btn:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
    transform: translateY(-2px);
}

/* Stories Area Styles */
.stories-container {
    background: white;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    padding: 20px 0;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.stories-title {
    font-size: 0.95rem;
    margin-bottom: 15px;
    font-weight: 700;
    margin-top: 0;
    padding-left: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stories-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 0 20px 10px 20px;
    scrollbar-width: none;
}

.stories-scroll::-webkit-scrollbar {
    display: none;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 72px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s;
}

.story-item:active {
    transform: scale(0.95);
}

.story-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    position: relative;
}

.story-ring.seen {
    background: #e2e8f0;
}

.story-circle {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid white;
}

.story-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-circle i {
    font-size: 1.5rem;
    color: #cbd5e1;
}

.story-title {
    font-size: 0.7rem;
    color: #475569;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sidebar Navigation */
.nav-widget {
    padding: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    transition: all 0.2s;
}

.nav-item i {
    width: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 1.1rem;
}

.nav-item:hover {
    background: #f8fafc;
    color: var(--primary);
}

.nav-item:hover i {
    color: var(--primary);
}

.nav-item.active {
    background: #eef2ff;
    color: var(--primary);
}

/* Categories Widget */
.categories-widget {
    padding: 0;
    overflow: hidden;
}

.widget-header-acc {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.widget-header-acc h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
}

.rotate-icon {
    transition: transform 0.3s;
    font-size: 0.8rem;
    color: #94a3b8;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.open {
    max-height: 400px;
    overflow-y: auto;
}

.category-list {
    display: flex;
    flex-direction: column;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    text-decoration: none;
    color: #64748b;
    font-size: 0.9rem;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.2s;
}

.category-item:hover {
    background: #f8fafc;
    color: #334155;
}

.cat-count {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* CTA Widget */
.cta-widget {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    text-align: center;
    border: none;
}

.cta-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.cta-content h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.cta-content p {
    margin: 0 0 15px 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.btn-cta {
    display: inline-block;
    background: white;
    color: #6366f1;
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.btn-cta:hover {
    transform: translateY(-2px);
    color: #4f46e5;
}

/* Trending Widget */
.trending-widget .widget-header {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.trending-widget h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trending-widget h3 i {
    color: #ef4444;
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.trending-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    align-items: flex-start;
}

.trend-rank {
    font-size: 0.9rem;
    font-weight: 700;
    color: #cbd5e1;
    min-width: 24px;
}

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

.trend-title {
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: color 0.2s;
}

.trending-item:hover .trend-title {
    color: var(--primary);
}

.trend-meta {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Footer Sidebar */
.sidebar-footer {
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 15px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.sidebar-footer a {
    color: #94a3b8;
    text-decoration: none;
}


/* Mobile Top Nav */
.mobile-top-nav {
    display: none;
    position: sticky;
    top: 60px;
    z-index: 90;
    background: white;
    border-bottom: 1px solid #f1f5f9;
    padding: 0 15px;
    overflow-x: auto;
    white-space: nowrap;
    margin-top: -30px;
    margin-bottom: 20px;
}

.mobile-nav-item {
    display: inline-block;
    padding: 15px 15px;
    color: #64748b;
    font-weight: 600;
    position: relative;
    text-decoration: none;
}

.mobile-nav-item.active {
    color: var(--primary);
}

.active-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    border-radius: 3px 3px 0 0;
}

.mobile-nav-item.active .active-indicator {
    background: var(--primary);
}

@media (max-width: 900px) {
    .mobile-top-nav {
        display: block;
    }

    .sidebar-left {
        display: none;
    }
}

/* Skeleton Loader */
.skeleton-loader {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.skeleton-card {
    background: #f1f5f9;
    height: 300px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.skeleton-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.2) 20%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0));
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}