/* ===================================
   FEED - PWA RESPONSIVE
   =================================== */

/* CONTAINER */
.feed-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* PAGE HEADER */
.feed-page-header {
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.feed-hero-title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    background: linear-gradient(135deg, #e50914, #ff4757);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.feed-hero-subtitle {
    color: var(--text-secondary);
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    font-weight: 500;
}

/* GRID LAYOUT */
.feed-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

/* FEED MAIN */
.feed-main {
    min-width: 0; /* Prevent overflow */
}

/* POST CARD */
.feed-post {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.feed-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(229, 9, 20, 0.15);
    border-color: rgba(229, 9, 20, 0.3);
}

/* POST HEADER */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.post-author {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.author-avatar {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #e50914, #c20812);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.author-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.post-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* POST CONTENT */
.post-content {
    margin-bottom: 1.25rem;
}

.post-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.post-content p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* POST IMAGE */
.post-image-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    margin: 1.25rem 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.feed-post:hover .post-image-placeholder {
    transform: scale(1.01);
}

/* POST ACTIONS */
.post-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1.25rem;
    border-top: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.post-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px; /* Touch target */
}

.post-action-btn:hover {
    background: rgba(229, 9, 20, 0.1);
    border-color: rgba(229, 9, 20, 0.3);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.2);
}

.post-action-btn:active {
    transform: translateY(0);
}

/* SIDEBAR */
.feed-sidebar {
    position: sticky;
    top: 8rem;
}

.sidebar-widget {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.sidebar-widget:hover {
    border-color: rgba(229, 9, 20, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* TRENDING */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.trending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    transition: all 0.3s;
}

.trending-item:hover {
    background: rgba(229, 9, 20, 0.05);
    border-color: rgba(229, 9, 20, 0.2);
    transform: translateX(4px);
}

.trending-tag {
    font-weight: 700;
    font-size: 0.95rem;
    color: #e50914;
}

.trending-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

/* SUGGESTIONS */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s;
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.suggestion-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #e50914, #c20812);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.suggestion-info {
    flex: 1;
    min-width: 0;
}

.suggestion-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-follow {
    background: linear-gradient(135deg, #e50914, #c20812);
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
    min-height: 44px; /* Touch target */
}

.btn-follow:hover {
    background: linear-gradient(135deg, #ff1f2f, #e50914);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(229, 9, 20, 0.5);
}

.btn-follow:active {
    transform: translateY(0) scale(0.98);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Large Desktop */
@media (min-width: 1400px) {
    .feed-container {
        max-width: 1400px;
    }
    
    .feed-grid {
        grid-template-columns: 1fr 420px;
    }
}

/* Desktop/Laptop */
@media (max-width: 1200px) {
    .feed-grid {
        grid-template-columns: 1fr 340px;
        gap: 1.5rem;
    }
}

/* Tablet */
@media (max-width: 992px) {
    .feed-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .feed-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .sidebar-widget {
        margin-bottom: 0;
    }
}

/* Mobile Large */
@media (max-width: 768px) {
    .feed-container {
        padding: 0 0.75rem;
    }
    
    .feed-page-header {
        margin-bottom: 1.5rem;
        padding: 0.75rem 0;
    }
    
    .feed-post {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
        border-radius: 16px;
    }
    
    .author-avatar {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }
    
    .author-name {
        font-size: 0.95rem;
    }
    
    .post-time {
        font-size: 0.8rem;
    }
    
    .post-content h3 {
        font-size: 1.2rem;
    }
    
    .post-content p {
        font-size: 0.95rem;
    }
    
    .post-image-placeholder {
        height: 180px;
        font-size: 3rem;
        margin: 1rem 0;
    }
    
    .post-actions {
        gap: 0.5rem;
        padding-top: 1rem;
    }
    
    .post-action-btn {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    
    .feed-sidebar {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .sidebar-widget {
        padding: 1.5rem;
    }
    
    .widget-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
}

/* Mobile Medium */
@media (max-width: 480px) {
    .feed-container {
        padding: 0 0.5rem;
    }
    
    .feed-page-header {
        margin-bottom: 1.25rem;
    }
    
    .feed-post {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 14px;
    }
    
    .author-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    .post-author {
        gap: 0.75rem;
    }
    
    .author-name {
        font-size: 0.9rem;
    }
    
    .post-time {
        font-size: 0.75rem;
    }
    
    .post-content h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .post-content p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .post-image-placeholder {
        height: 160px;
        font-size: 2.5rem;
        border-radius: 12px;
    }
    
    .post-actions {
        gap: 0.4rem;
        padding-top: 0.875rem;
    }
    
    .post-action-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
        border-radius: 40px;
    }
    
    .sidebar-widget {
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .widget-title {
        font-size: 1rem;
    }
    
    .trending-item {
        padding: 0.875rem;
    }
    
    .trending-tag {
        font-size: 0.9rem;
    }
    
    .trending-count {
        font-size: 0.8rem;
    }
    
    .suggestion-avatar {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }
    
    .suggestion-name {
        font-size: 0.9rem;
    }
    
    .suggestion-desc {
        font-size: 0.75rem;
    }
    
    .btn-follow {
        padding: 0.55rem 1rem;
        font-size: 0.8rem;
    }
}

/* PWA Mode Adjustments */
body.pwa-mode .feed-container {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

/* iOS Safe Areas */
@supports (padding: max(0px)) {
    .feed-container {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }
}

/* Touch Optimization */
@media (hover: none) and (pointer: coarse) {
    .post-action-btn,
    .btn-follow,
    .trending-item {
        min-height: 48px; /* WCAG touch target */
    }
    
    .post-action-btn:active {
        background: rgba(229, 9, 20, 0.2);
    }
    
    .trending-item:active {
        background: rgba(229, 9, 20, 0.1);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .feed-post,
    .sidebar-widget {
        border-width: 3px;
    }
    
    .post-action-btn,
    .btn-follow {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .feed-post,
    .post-action-btn,
    .trending-item,
    .btn-follow,
    .sidebar-widget {
        transition: none;
    }
    
    .feed-post:hover,
    .post-action-btn:hover,
    .btn-follow:hover {
        transform: none;
    }
}


/* Botão de Criar Post */
.btn-create-post {
    background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
    color: #ffffff;
    border: none;
    padding: 0.9rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3);
}

.btn-create-post:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.5);
    text-decoration: none;
    color: #ffffff;
}

/* Header do Feed Atualizado */
.feed-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

/* Botão de Curtir - Estado Curtido */
.post-action-btn.curtido {
    background: rgba(229, 9, 20, 0.2);
    border-color: #e50914;
    color: #e50914;
    font-weight: 700;
}

.post-action-btn.curtido:hover {
    background: rgba(229, 9, 20, 0.3);
}

/* Alert de Sucesso */
.alert-success {
    background: rgba(70, 211, 105, 0.15);
    border: 2px solid rgba(70, 211, 105, 0.4);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    color: #46d369;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
}

/* Responsivo para botão de criar */
@media (max-width: 768px) {
    .feed-page-header {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .btn-create-post {
        width: 100%;
        justify-content: center;
    }
}
