﻿/* TV Dashboard Styles */
.tv-dashboard {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.tv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.tv-logo {
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .tv-logo i {
        color: #00d4ff;
    }

.tv-datetime {
    text-align: center;
}

.tv-time {
    font-size: 36px;
    font-weight: bold;
    letter-spacing: 2px;
}

.tv-date {
    font-size: 14px;
    opacity: 0.8;
    text-transform: uppercase;
}

.tv-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

    .status-indicator.online {
        background: #4caf50;
    }

    .status-indicator.offline {
        background: #f44336;
    }

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Main Grid */
.tv-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    padding: 15px;
    overflow: hidden;
}

/* Cards */
.tv-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    animation: slideIn 0.5s ease-out;
}

    .tv-card h2 {
        margin: 0 0 15px 0;
        font-size: 20px;
        display: flex;
        align-items: center;
        gap: 10px;
        color: #fff;
    }

        .tv-card h2 i {
            color: #00d4ff;
        }

/* Metrics Card */
.metrics-card {
    grid-column: span 2;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.metric-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    position: relative;
    overflow: hidden;
}

.metric-value {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 14px;
    opacity: 0.9;
}

.metric-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    opacity: 0.2;
}

.metric-progress {
    margin-top: 10px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    transition: width 1s ease;
}

/* Ranking Card */
.ranking-card {
    grid-row: span 2;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px 15px;
    transition: all 0.3s;
}

    .ranking-item:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateX(5px);
    }

    .ranking-item.first {
        background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 193, 7, 0.1));
        border: 1px solid rgba(255, 215, 0, 0.3);
    }

    .ranking-item.second {
        background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(169, 169, 169, 0.1));
        border: 1px solid rgba(192, 192, 192, 0.3);
    }

    .ranking-item.third {
        background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(184, 115, 51, 0.1));
        border: 1px solid rgba(205, 127, 50, 0.3);
    }

.ranking-position {
    width: 50px;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .ranking-position i {
        color: #ffd700;
    }

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-weight: 600;
    font-size: 16px;
}

.ranking-stats {
    display: flex;
    gap: 10px;
    margin-top: 2px;
}

.stat-item {
    font-size: 12px;
    opacity: 0.8;
}

.stat-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.1);
}

    .stat-badge.working {
        background: rgba(76, 175, 80, 0.3);
        color: #81c784;
    }

    .stat-badge.available {
        background: rgba(33, 150, 243, 0.3);
        color: #64b5f6;
    }

.ranking-score {
    text-align: center;
}

.score-value {
    font-size: 24px;
    font-weight: bold;
    color: #00d4ff;
}

.score-label {
    font-size: 11px;
    opacity: 0.7;
}

/* Stages Card */
.stages-card {
    grid-column: span 2;
}

.stages-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stage-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stage-header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .stage-header i {
        color: #00d4ff;
    }

.stage-stats {
    margin-bottom: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
    opacity: 0.9;
}

.stage-efficiency {
    margin-top: 10px;
}

.efficiency-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.efficiency-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    transition: width 1s ease;
}

.efficiency-text {
    font-size: 11px;
    opacity: 0.8;
}

.stage-workers {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    opacity: 0.8;
}

.stage-empty {
    font-size: 11px;
    opacity: 0.5;
    font-weight: normal;
    margin-left: 8px;
}

/* Ajustes para visualização de cidades */
.cities-list {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 5px;
}

    .cities-list::-webkit-scrollbar {
        width: 6px;
    }

    .cities-list::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 3px;
    }

    .cities-list::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.4);
        border-radius: 3px;
    }

        .cities-list::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.5);
        }

/* Cities Card Enhanced */
.city-item-enhanced {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    .city-item-enhanced:hover {
        background: rgba(255, 255, 255, 0.12);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 212, 255, 0.1);
    }

.city-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.city-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.city-total {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.city-share {
    font-size: 12px;
    opacity: 0.7;
    margin-left: 5px;
}

.city-status-breakdown {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

    .status-item i {
        font-size: 12px;
    }

    .status-item.completed {
        color: #4caf50;
    }

    .status-item.in-progress {
        color: #ff9800;
    }

    .status-item.pending {
        color: #2196f3;
    }

.city-progress {
    margin: 10px 0;
}

.progress-bar-container {
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}

.progress-segment {
    height: 100%;
    transition: width 1s ease;
}

    .progress-segment.completed {
        background: linear-gradient(90deg, #4caf50, #8bc34a);
    }

    .progress-segment.in-progress {
        background: linear-gradient(90deg, #ff9800, #ffc107);
    }

    .progress-segment.pending {
        background: linear-gradient(90deg, #2196f3, #03a9f4);
    }

.city-trend {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 8px;
}

    .city-trend.positive {
        background: rgba(76, 175, 80, 0.2);
        color: #81c784;
    }

    .city-trend.negative {
        background: rgba(244, 67, 54, 0.2);
        color: #ef5350;
    }

.more-cities {
    text-align: center;
    padding: 10px;
    font-size: 13px;
    opacity: 0.7;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 10px;
}

.no-data-message {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.7;
}

    .no-data-message i {
        font-size: 48px;
        margin-bottom: 15px;
        color: rgba(255, 255, 255, 0.3);
    }

    .no-data-message p {
        margin: 10px 0 5px 0;
        font-size: 14px;
    }

    .no-data-message small {
        font-size: 12px;
        opacity: 0.6;
    }

/* Insights Card */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.insight-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

    .insight-item i {
        font-size: 20px;
    }

.insight-text {
    flex: 1;
    font-size: 13px;
}

.trend {
    margin-left: 5px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

    .trend.up {
        background: rgba(76, 175, 80, 0.2);
        color: #81c784;
    }

    .trend.down {
        background: rgba(244, 67, 54, 0.2);
        color: #ef5350;
    }

/* Activities Card */
.activities-card {
    grid-row: span 2;
}

.activities-feed {
    max-height: 400px;
    overflow-y: auto;
}

    .activities-feed::-webkit-scrollbar {
        width: 5px;
    }

    .activities-feed::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
    }

    .activities-feed::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
    }

.activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    animation: slideInRight 0.3s ease-out;
}

.activity-time {
    font-size: 12px;
    opacity: 0.7;
    min-width: 45px;
}

.activity-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.activity-content {
    flex: 1;
    font-size: 13px;
}

.activity-stage {
    opacity: 0.7;
    font-size: 11px;
}

/* Footer */
.tv-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    opacity: 0.8;
}

    .footer-item i {
        color: #00d4ff;
    }


.chart-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 400px;
}

.chart-container {
    padding: 20px;
}

.chart-card h2 {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */

/* 4K TVs (3840px) */
@media (min-width: 2560px) {
    .tv-grid {
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 20px;
        padding: 20px;
    }

    .tv-card h2 {
        font-size: 24px;
    }

    .metric-value {
        font-size: 48px;
    }
}

/* Full HD TVs e Monitores grandes (1920px) */
@media (max-width: 2559px) and (min-width: 1920px) {
    .tv-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 15px;
        padding: 15px;
    }
}

/* Laptops e monitores médios (1440px) */
@media (max-width: 1919px) and (min-width: 1440px) {
    .tv-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto;
        gap: 12px;
        padding: 12px;
    }

    .metrics-card {
        grid-column: span 2;
    }

    .ranking-card {
        grid-column: span 1;
        grid-row: span 1;
    }

    .stages-card {
        grid-column: span 3;
    }

    .cities-card {
        grid-column: span 2;
    }

    .activities-card {
        grid-column: span 1;
    }

    .insights-card {
        grid-column: span 3;
    }
}

/* Tablets landscape (1024px) */
@media (max-width: 1439px) and (min-width: 1024px) {
    .tv-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 10px;
        padding: 10px;
    }

    .tv-card {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .metrics-card, .stages-card, .insights-card {
        grid-column: span 2 !important;
    }

    .metric-value {
        font-size: 28px;
    }

    .tv-time {
        font-size: 28px;
    }

    .stages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets portrait e móveis grandes (768px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .tv-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 10px;
        padding: 10px;
    }

    .tv-card {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stages-grid {
        grid-template-columns: 1fr;
    }

    .insights-grid {
        grid-template-columns: 1fr;
    }

    .tv-header {
        padding: 10px 15px;
    }

    .tv-time {
        font-size: 24px;
    }
}

/* Móveis (menos de 768px) */
@media (max-width: 767px) {
    .tv-dashboard {
        position: relative;
        height: auto;
        min-height: 100vh;
    }

    .tv-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 8px;
        padding: 8px;
    }

    .tv-card {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        padding: 15px;
    }

    .tv-header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
        text-align: center;
    }

    .tv-logo {
        font-size: 20px;
    }

    .tv-time {
        font-size: 20px;
    }

    .metric-value {
        font-size: 24px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .stages-grid {
        grid-template-columns: 1fr;
    }

    .insights-grid {
        grid-template-columns: 1fr;
    }

    .tv-footer {
        flex-direction: column;
        gap: 5px;
        padding: 10px;
    }

    .ranking-list {
        max-height: 400px;
    }

    .cities-list {
        max-height: 400px;
    }

    .activities-feed {
        max-height: 300px;
    }
}

/* Utility Classes */
.text-success {
    color: #4caf50 !important;
}

.text-warning {
    color: #ff9800 !important;
}

.text-danger {
    color: #f44336 !important;
}

.text-info {
    color: #2196f3 !important;
}

.text-primary {
    color: #00d4ff !important;
}

.text-secondary {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Descarregamentos Ativos */
.unloading-card {
    grid-column: span 1;
}

.unloading-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.unloading-item {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-left: 4px solid #00d4ff;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s;
}

    .unloading-item.warning {
        border-left-color: #ffa500;
        animation: pulse-warning 2s infinite;
    }

@keyframes pulse-warning {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.unloading-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.unloading-collaborator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.unloading-duration {
    font-size: 1.2rem;
    font-weight: bold;
    color: #00d4ff;
}

.unloading-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #b0b0b0;
    margin-bottom: 8px;
}

.unloading-status {
    padding: 2px 8px;
    background: rgba(0, 212, 255, 0.2);
    border-radius: 4px;
}

.unloading-alert {
    background: rgba(255, 165, 0, 0.2);
    border: 1px solid #ffa500;
    border-radius: 6px;
    padding: 8px;
    margin-top: 10px;
    color: #ffa500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
