/* Tracking Page Styles */

/* Page Hero */
.page-hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-pattern {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
}

.floating-elements circle {
    animation: float 6s ease-in-out infinite;
}

.float-1 {
    animation-delay: 0s;
}

.float-2 {
    animation-delay: 2s;
}

.float-3 {
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.page-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Tracking Form Section */
.tracking-form-section {
    padding: 80px 0;
    background: var(--light-bg);
}

.tracking-form-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.form-header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.form-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--text-light);
    font-size: 1.125rem;
}

.tracking-options {
    padding: 2rem;
}

/* Option Tabs */
.option-tabs {
    display: flex;
    background: var(--light-bg);
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-color);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(15, 163, 163, 0.1);
    transform: translateY(-1px);
}

.form-group input:invalid {
    border-color: #ef4444;
}

.form-help {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.track-btn {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.track-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.track-btn:hover:before {
    left: 100%;
}

.track-btn i {
    margin-right: 0.5rem;
}

/* Tracking Results */
.tracking-results {
    padding: 80px 0;
    background: white;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.refresh-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.last-updated {
    font-size: 0.875rem;
    color: var(--text-light);
}

.refresh-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.refresh-btn i {
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.refresh-btn:hover i {
    transform: rotate(180deg);
}

.results-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Map Container */
.map-container {
    position: relative;
    background: var(--light-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    min-height: 400px;
}

.tracking-map {
    width: 100%;
    height: 400px;
    border-radius: 16px;
}

.map-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.map-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    color: var(--text-color);
}

.map-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: scale(1.1);
}

/* Results Table */
.results-table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--light-bg);
    border-bottom: 1px solid #e2e8f0;
}

.table-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

.status-dot.loading {
    background: #f59e0b;
}

.status-dot.error {
    background: #ef4444;
    animation: none;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.status-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

.table-wrapper {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 1rem 2rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.results-table th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-table td {
    color: var(--text-color);
    font-size: 0.95rem;
}

.results-table tr:hover {
    background: rgba(15, 163, 163, 0.05);
}

/* Tracking Timeline */
.tracking-timeline {
    padding: 2rem;
    border-top: 1px solid #e2e8f0;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 40px;
    width: 2px;
    height: calc(100% + 0.5rem);
    background: #e2e8f0;
}

.timeline-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    flex-shrink: 0;
    z-index: 1;
    position: relative;
}

.timeline-dot.current {
    background: var(--accent-color);
    animation: pulse 2s infinite;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.timeline-description {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.timeline-time {
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    margin-bottom: 1rem;
}

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-state p {
    color: var(--text-light);
    font-size: 1.125rem;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 4rem 2rem;
}

.error-icon {
    font-size: 4rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

.error-state h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-state p {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

/* Tracking Tips */
.tracking-tips {
    padding: 80px 0;
    background: var(--light-bg);
}

.tracking-tips h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 3rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.tip-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.tip-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
}

.tip-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
    transition: transform 0.3s ease;
}

.tip-card:hover .tip-icon {
    transform: scale(1.1) rotate(5deg);
}

.tip-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tip-card p {
    color: var(--text-color);
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .results-content {
        grid-template-columns: 1fr;
    }
    
    .tracking-map {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2.5rem;
    }
    
    .page-subtitle {
        font-size: 1.125rem;
    }
    
    .tracking-form-container {
        margin: 0 1rem;
    }
    
    .form-header {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .tracking-options {
        padding: 1.5rem;
    }
    
    .option-tabs {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .tab-btn {
        padding: 0.75rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .refresh-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.75rem 1rem;
    }
    
    .tracking-timeline {
        padding: 1rem;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .page-hero {
        padding: 100px 0 60px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .tracking-form-section {
        padding: 60px 0;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
    }
    
    .form-header p {
        font-size: 1rem;
    }
    
    .tracking-map {
        height: 250px;
    }
    
    .map-controls {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .map-btn {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    
    .tip-card {
        padding: 1.5rem;
    }
    
    .tip-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Dark Mode */
body.dark .tracking-form-container {
    background: var(--card-bg-dark);
}

body.dark .form-header {
    background: linear-gradient(135deg, var(--bg-dark), #1a1a1a);
}

body.dark .form-header h2 {
    color: var(--text-dark);
}

body.dark .form-header p {
    color: var(--text-light-dark);
}

body.dark .option-tabs {
    background: var(--bg-dark);
}

body.dark .tab-btn {
    color: var(--text-light-dark);
}

body.dark .tab-btn.active {
    background: var(--card-bg-dark);
    color: var(--text-dark);
}

body.dark .tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dark);
}

body.dark .form-group label {
    color: var(--text-dark);
}

body.dark .form-group input {
    background: var(--bg-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

body.dark .form-group input:focus {
    border-color: var(--secondary-color);
    background: var(--card-bg-dark);
}

body.dark .form-help {
    color: var(--text-light-dark);
}

body.dark .results-header h2 {
    color: var(--text-dark);
}

body.dark .last-updated {
    color: var(--text-light-dark);
}

body.dark .results-table-container {
    background: var(--card-bg-dark);
}

body.dark .table-header {
    background: var(--bg-dark);
    border-color: var(--border-dark);
}

body.dark .table-header h3 {
    color: var(--text-dark);
}

body.dark .status-text {
    color: var(--text-dark);
}

body.dark .results-table th {
    background: var(--bg-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

body.dark .results-table td {
    color: var(--text-dark);
    border-color: var(--border-dark);
}

body.dark .results-table tr:hover {
    background: rgba(15, 163, 163, 0.1);
}

body.dark .tracking-timeline {
    border-color: var(--border-dark);
}

body.dark .timeline-title {
    color: var(--text-dark);
}

body.dark .timeline-description,
body.dark .timeline-time {
    color: var(--text-light-dark);
}

body.dark .loading-state p {
    color: var(--text-light-dark);
}

body.dark .error-state h3 {
    color: var(--text-dark);
}

body.dark .error-state p {
    color: var(--text-light-dark);
}

body.dark .tracking-tips h2 {
    color: var(--text-dark);
}

body.dark .tip-card {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
}

body.dark .tip-card h3 {
    color: var(--text-dark);
}

body.dark .tip-card p {
    color: var(--text-light-dark);
}

/* Map Marker Styles */
.mapboxgl-marker {
    cursor: pointer;
}

.vehicle-marker {
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: markerPulse 2s infinite;
}

@keyframes markerPulse {
    0% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(15, 163, 163, 0.7);
    }
    70% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 0 20px rgba(15, 163, 163, 0);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(15, 163, 163, 0);
    }
}

/* Popup Styles */
.mapboxgl-popup-content {
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.popup-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.popup-info {
    font-size: 0.875rem;
    color: var(--text-color);
    line-height: 1.4;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

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

/* Utility Classes */
.text-success {
    color: #10b981;
}

.text-warning {
    color: #f59e0b;
}

.text-error {
    color: #ef4444;
}

.bg-success {
    background-color: #10b981;
}

.bg-warning {
    background-color: #f59e0b;
}

.bg-error {
    background-color: #ef4444;
}

/* Print Styles */
@media print {
    .page-hero {
        background: none;
        color: black;
    }
    
    .tracking-form-container,
    .results-table-container,
    .tip-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .map-container {
        display: none;
    }
    
    .floating-elements {
        display: none;
    }
}