/* assets/css/track.css */
/* Citizen Incident Tracking Module Styles */

:root {
    --primary-color: #0D47A1;
    --primary-light: #1565C0;
    --success-color: #43A047;
    --warning-color: #F57C00;
    --danger-color: #D32F2F;
    --info-color: #0288D1;
    --bg-color: #F5F7FA;
    --card-bg: #FFFFFF;
    --text-color: #263238;
    --text-muted: #78909C;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.10);
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== HEADER ===== */
.app-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(13, 71, 161, 0.3);
}

.app-header h5 {
    font-weight: 700;
}

.app-header small {
    opacity: 0.8;
    font-weight: 300;
}

/* ===== CARDS ===== */
.card {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: var(--card-bg);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: 1.25rem;
}

.tracking-summary {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--primary-color);
    padding: 1.25rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.summary-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #E3F2FD;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.summary-label,
.summary-code span {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tracking-summary h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0.15rem 0;
}

.tracking-summary p {
    color: var(--text-muted);
    margin: 0;
}

.summary-code {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    min-width: 220px;
}

.summary-code strong {
    display: block;
    font-size: 0.95rem;
}

.tracking-summary.status-responding {
    border-left-color: var(--warning-color);
}

.tracking-summary.status-responding .summary-icon {
    background: #FFF3E0;
    color: var(--warning-color);
}

.tracking-summary.status-closed {
    border-left-color: var(--success-color);
}

.tracking-summary.status-closed .summary-icon {
    background: #E8F5E9;
    color: var(--success-color);
}

.tracking-summary.status-rejected {
    border-left-color: var(--danger-color);
}

.tracking-summary.status-rejected .summary-icon {
    background: #FFEBEE;
    color: var(--danger-color);
}

/* ===== TIMELINE ===== */
.timeline {
    position: relative;
    padding: 0.5rem 0;
}

.timeline-item {
    position: relative;
    padding: 0.75rem 0 0.75rem 2.5rem;
    border-left: 3px solid #e0e0e0;
    margin-left: 1rem;
    transition: var(--transition);
}

.timeline-item:last-child {
    border-left-color: transparent;
}

.timeline-item .timeline-icon {
    position: absolute;
    left: -1.1rem;
    top: 0.6rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
    z-index: 2;
    transition: var(--transition);
}

.timeline-item.completed .timeline-icon {
    background: var(--success-color);
}

.timeline-item.active .timeline-icon {
    background: var(--warning-color);
    animation: pulse 1.5s ease-in-out infinite;
}

.timeline-item.rejected .timeline-icon {
    background: var(--danger-color);
}

.timeline-item .timeline-content {
    padding: 0.25rem 0;
}

.timeline-item .timeline-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
}

.timeline-item .timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-item.completed .timeline-title {
    color: var(--success-color);
}

.timeline-item.active .timeline-title {
    color: var(--warning-color);
}

.timeline-item.rejected .timeline-title {
    color: var(--danger-color);
}

/* ===== STATUS BADGE ===== */
.status-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.status-badge.pending {
    background: #FFF3E0;
    color: #E65100;
}

.status-badge.verified {
    background: #E3F2FD;
    color: #0D47A1;
}

.status-badge.responding {
    background: #FFF3E0;
    color: #E65100;
    animation: pulse-badge 2s ease-in-out infinite;
}

.status-badge.closed {
    background: #E8F5E9;
    color: #1B5E20;
}

.status-badge.rejected {
    background: #FFEBEE;
    color: #B71C1C;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== MAP ===== */
#trackingMap {
    height: 400px;
    width: 100%;
    border-radius: 12px 12px 0 0;
    background: #e8ecf1;
}

.map-stats {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #e8ecf1;
}

.map-stats .stat-item {
    text-align: center;
}

.map-stats .stat-item i {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.map-stats .stat-item span {
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
}

.map-stats .stat-item small {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ===== PHOTO GALLERY ===== */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.photo-item:hover {
    transform: scale(1.02);
    border-color: var(--primary-color);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item .photo-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.6rem;
}

/* ===== RESPONDER INFO ===== */
.responder-info small {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.responder-info strong {
    font-size: 0.95rem;
}

/* ===== NOTIFICATIONS ===== */
#notificationContainer {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
}

.notification-toast {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--primary-color);
    pointer-events: auto;
    animation: slideInRight 0.4s ease;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.notification-toast .toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.notification-toast .toast-content {
    flex: 1;
}

.notification-toast .toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
}

.notification-toast .toast-message {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.notification-toast .toast-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.notification-toast.success {
    border-left-color: var(--success-color);
}

.notification-toast.warning {
    border-left-color: var(--warning-color);
}

.notification-toast.danger {
    border-left-color: var(--danger-color);
}

.notification-toast.info {
    border-left-color: var(--info-color);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .tracking-summary {
        grid-template-columns: 1fr;
    }

    .summary-code {
        min-width: 0;
    }

    #trackingMap {
        height: 300px;
    }
    
    .map-stats {
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .map-stats .stat-item {
        flex: 1;
        min-width: 80px;
    }
    
    .map-stats .stat-item span {
        font-size: 0.95rem;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .timeline-item {
        padding-left: 2rem;
    }
    
    .timeline-item .timeline-icon {
        left: -0.9rem;
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.6rem;
    }
    
    #notificationContainer {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: 100%;
        width: auto;
    }
}

@media (max-width: 576px) {
    .app-header h5 {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    #trackingMap {
        height: 250px;
    }
    
    .status-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.75rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ===== LOADING SKELETON ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}
