/* Feed */
.feed-container {
    width: 100%;
    max-width: 1100px;
    margin: 30px auto;
    box-sizing: border-box;
    overflow-x: hidden;
}
.feed-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 20px;
}
.feed-table th {
    text-align: left;
    padding: 12px 15px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.05em;
}
.feed-row {
    background-color: var(--card-bg);
    transition: transform 0.2s, background-color 0.2s;
}
.feed-row:hover {
    transform: scale(1.01);
    background-color: #252525;
}
.feed-row td {
    padding: 15px;
    text-align: left;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.feed-row td:first-child { border-left: 1px solid var(--border-color); border-radius: 12px 0 0 12px; }
.feed-row td:last-child { border-right: 1px solid var(--border-color); border-radius: 0 12px 12px 0; }

.user-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #333;
}
.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}
.tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: normal;
}
.tag-route { background: rgba(33, 150, 243, 0.15); color: var(--accent); }
.tag-vote { background: rgba(76, 175, 80, 0.15); color: #4caf50; }
.tag-one-way { background: rgba(33, 150, 243, 0.15); color: #2196f3; }
.tag-waiting { background: rgba(255, 152, 0, 0.15); color: #ff9800; }
.tag-absence { background: rgba(244, 67, 54, 0.15); color: #f44336; }
.timestamp-cell {
    font-size: 0.8rem;
    color: #777;
    font-family: monospace;
    width: 1%;
    white-space: nowrap;
}
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #4caf50;
}
.dot {
    width: 6px;
    height: 6px;
    background-color: #4caf50;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* Paginação */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-bottom: 20px;
    flex-wrap: wrap;
}
.btn-page {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    min-width: 36px;
}
.btn-page:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
.btn-page.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}
.btn-page:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.btn-page-extreme {
    padding: 6px 8px !important;
    min-width: 30px !important;
}
.btn-page-extreme i {
    width: 14px !important;
    height: 14px !important;
}
.pagination-info {
    font-size: 0.85rem;
    color: #888;
    margin: 0 10px;
}

/* Tabs */
.feed-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}
.feed-tab {
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    background: #252525;
    color: #888;
    transition: all 0.2s;
}
.feed-tab.active {
    background: var(--accent);
    color: white;
}

/* Próximas Enquetes */
#nextPollsList {
    display: flex;
    flex-direction: column;
}
.poll-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 12px;
    transition: background 0.2s;
    flex-wrap: wrap;
}
.poll-item:last-child {
    border-bottom: none;
}
.calendar-box {
    width: 52px;
    height: 52px;
    background: #161616;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.calendar-box .cal-icon {
    color: #666;
    margin-bottom: 4px;
    width: 16px;
    height: 16px;
}
.calendar-box .cal-date {
    font-size: 9px;
    font-weight: 600;
    color: #ddd;
    text-transform: uppercase;
    line-height: 1.1;
    text-align: center;
}
.poll-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.poll-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1px;
}
.poll-subtitle {
    font-size: 0.8rem;
    color: #888888;
}
.status-badge {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}
.status-agendada {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border-color: rgba(76, 175, 80, 0.2);
}
.status-pendente {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
    border-color: rgba(255, 152, 0, 0.2);
}
.status-rascunho {
    background: rgba(158, 158, 158, 0.1);
    color: #9e9e9e;
    border-color: rgba(158, 158, 158, 0.2);
}
.status-bloqueada {
    background: rgba(244, 67, 54, 0.05);
    color: #f44336;
    border-color: rgba(244, 67, 54, 0.1);
    opacity: 0.6;
}
.weather-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-right: 5px;
}
.weather-tag .temp-val {
    font-weight: 700;
    color: #fff;
}
.weather-icon {
    width: 14px;
    height: 14px;
    color: var(--accent);
}

/* Ranking Badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.07);
    color: #888;
    gap: 3px;
}
.rank-gold {
    background: rgba(255, 214, 0, 0.15);
    color: #ffd600;
    border: 1px solid rgba(255, 214, 0, 0.3);
}
.rank-silver {
    background: rgba(192, 192, 192, 0.15);
    color: #c0c0c0;
    border: 1px solid rgba(192, 192, 192, 0.3);
}
.rank-bronze {
    background: rgba(205, 127, 50, 0.15);
    color: #cd7f32;
    border: 1px solid rgba(205, 127, 50, 0.3);
}

.btn-load-more {
    background: rgba(33, 150, 243, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}
.btn-load-more:hover {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* === Responsivo Mobile === */
@media (max-width: 768px) {
    .feed-container {
        margin: 15px auto;
    }
    .search-container {
        flex-direction: column;
        width: 100%;
    }
    .search-container select, .search-container input {
        width: 100%;
        min-width: unset !important;
        flex: unset !important;
    }
    .feed-table th {
        padding: 8px 6px;
        font-size: 0.65rem;
    }
    .feed-row td {
        padding: 10px 6px;
        font-size: 0.8rem;
    }
    .user-name {
        font-size: 0.8rem;
    }
    .user-avatar {
        width: 30px;
        height: 30px;
    }
    .user-cell {
        gap: 8px;
    }
    .tag {
        font-size: 0.6rem;
        padding: 3px 6px;
    }
    .timestamp-cell {
        font-size: 0.7rem;
    }
    .poll-item {
        gap: 8px;
        flex-wrap: nowrap;
    }
    .poll-info {
        min-width: 0;
    }
    .poll-title {
        font-size: 0.85rem;
        white-space: normal;
    }
    .poll-subtitle {
        font-size: 0.7rem;
    }
    .status-badge {
        font-size: 0.65rem;
        padding: 3px 10px;
        flex-shrink: 0;
    }
    .weather-tag {
        display: none;
    }
    .calendar-box {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }
}

@media (max-width: 600px) {
    #feedHeader {
        display: none;
    }

    .feed-table, #voteFeedBody {
        display: block;
        width: 100%;
    }

    .vote-row {
        display: grid !important;
        grid-template-areas: 
            "user time"
            "route response";
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        gap: 12px;
        padding: 16px;
        background-color: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 16px !important;
        margin-bottom: 12px;
        width: 100%;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }

    .vote-row td {
        display: block;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    /* Horário */
    .vote-row td:nth-child(1) {
        grid-area: time;
        text-align: right;
        justify-self: end;
        font-size: 0.85rem;
    }

    /* Estudante (Foto + Info) */
    .vote-row td:nth-child(2) {
        grid-area: user;
        align-self: center;
    }

    /* Rota */
    .vote-row td:nth-child(3) {
        grid-area: route;
        align-self: center;
    }

    /* Resposta (Voto) */
    .vote-row td:nth-child(4) {
        grid-area: response;
        justify-self: end;
        align-self: center;
    }

    .pending-row {
        display: grid !important;
        grid-template-areas: 
            "user status"
            "route status";
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        gap: 8px 12px;
        padding: 16px;
        background-color: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 16px !important;
        margin-bottom: 12px;
        width: 100%;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }

    .pending-row td {
        display: block;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    /* Estudante (Foto + Info) */
    .pending-row td:nth-child(1) {
        grid-area: user;
        align-self: end;
    }

    /* Rota */
    .pending-row td:nth-child(2) {
        grid-area: route;
        align-self: start;
    }

    /* Status (Pendente) */
    .pending-row td:nth-child(3) {
        grid-area: status;
        justify-self: end;
        align-self: center;
    }
}
