/* ============================================
   PAN TRACKING DASHBOARD - STYLES
   ============================================ */

:root {
    --bg-body: #f0f4f8;
    --bg-card: rgba(255, 255, 255, 0.65);
    --bg-header: rgba(255, 255, 255, 0.85);
    --text-main: #1e293b;
    --text-sub: #64748b;
    --border: rgba(255, 255, 255, 0.6);
    --shadow-card: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --primary: #3b82f6;
    --success: #10b981;
    --warning: #fbbf24;
    --danger: #ef4444;
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-header: rgba(15, 23, 42, 0.8);
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 30px 60px -15px rgba(0, 0, 0, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    transition: background-color 0.3s ease;
}

/* Header */
.tracking-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.back-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateX(-5px);
    border-color: var(--primary);
}

.header-title {
    flex: 1;
    text-align: center;
}

.header-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header-title h1 i {
    color: var(--primary);
}

.header-title p {
    font-size: 13px;
    color: var(--text-sub);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.refresh-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    transform: rotate(180deg);
    border-color: var(--primary);
    color: var(--primary);
}

/* Main Container */
.tracking-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Search Section */
.search-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-card);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-body);
    border: 2px solid var(--border);
    border-radius: 50px;
    padding: 5px 5px 5px 20px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-icon {
    color: var(--text-sub);
    font-size: 18px;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 16px;
    font-weight: 500;
    outline: none;
    padding: 10px;
    text-transform: uppercase;
}

.search-input::placeholder {
    color: var(--text-sub);
    opacity: 0.7;
    text-transform: none;
}

.search-btn {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.search-hint {
    margin-top: 15px;
    font-size: 13px;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-hint i {
    color: var(--primary);
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 500;
}

/* Applications Section */
.applications-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-card);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--primary);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--bg-body);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Application Card */
.app-card {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.app-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.app-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 5px;
}

.app-ack {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-ack-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.copy-ack-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.status-badge {
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.status-processing {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.status-done {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.app-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-size: 11px;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-value {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

/* Progress Timeline */
.progress-timeline {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.timeline-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: 20px;
}

.timeline-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.timeline-progress {
    position: absolute;
    top: 20px;
    left: 0;
    height: 2px;
    background: var(--primary);
    z-index: 1;
    transition: width 0.5s ease;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
    flex: 1;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-sub);
    transition: all 0.3s ease;
}

.timeline-step.active .step-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.timeline-step.completed .step-icon {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-label {
    font-size: 11px;
    color: var(--text-sub);
    text-align: center;
    font-weight: 500;
}

.timeline-step.active .step-label,
.timeline-step.completed .step-label {
    color: var(--text-main);
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-sub);
}

.empty-state i {
    font-size: 80px;
    opacity: 0.3;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--text-main);
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 30px;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 80px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    font-size: 14px;
    color: var(--text-sub);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-header);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-sub);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .back-btn {
        width: 100%;
        justify-content: center;
    }
    
    .header-title {
        text-align: center;
    }
    
    .header-title h1 {
        font-size: 20px;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .search-box {
        flex-direction: column;
        padding: 15px;
        border-radius: 15px;
    }
    
    .search-input {
        width: 100%;
        text-align: center;
    }
    
    .search-btn {
        width: 100%;
        justify-content: center;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .app-card-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .app-details {
        grid-template-columns: 1fr;
    }
    
    .timeline-steps {
        flex-direction: column;
        gap: 20px;
    }
    
    .timeline-steps::before {
        display: none;
    }
    
    .timeline-step {
        flex-direction: row;
        justify-content: flex-start;
    }
    
    .step-label {
        text-align: left;
    }
}


/* Resubmit Section */
.resubmit-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.resubmit-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid #10b981;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-main);
}

.resubmit-info i {
    color: #10b981;
    font-size: 18px;
}

.resubmit-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.resubmit-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.resubmit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.resubmit-btn:active {
    transform: translateY(0);
}

.resubmit-btn i {
    font-size: 16px;
}

.whatsapp-support-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.whatsapp-support-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.whatsapp-support-btn:active {
    transform: translateY(0);
}

.whatsapp-support-btn i {
    font-size: 16px;
}
