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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.controls-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.form-control {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-content p {
    color: #666;
    font-size: 14px;
}

.data-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.panel-header h2 {
    color: #333;
    font-size: 1.5rem;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: #f8f9fa;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e9ecef;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.location-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.map-container {
    height: 400px;
    background: #f8f9fa;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
}

.loading-spinner i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
}

.loading-spinner p {
    color: #666;
    font-size: 16px;
}

.message-body {
    max-width: 300px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.call-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.call-incoming {
    background: #d4edda;
    color: #155724;
}

.call-outgoing {
    background: #d1ecf1;
    color: #0c5460;
}

.call-missed {
    background: #f8d7da;
    color: #721c24;
}

.sms-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.sms-inbox {
    background: #d4edda;
    color: #155724;
}

.sms-sent {
    background: #d1ecf1;
    color: #0c5460;
}

@media (max-width: 768px) {
    .controls-panel {
        grid-template-columns: 1fr;
    }
    
    .stats-panel {
        grid-template-columns: 1fr;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 15px;
    }
}



/* Location Panel Styles */
.location-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.location-map-container {
    margin-top: 20px;
}

.location-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.google-map-frame {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.location-list {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.location-list h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2rem;
}

.location-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

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

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.location-index {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.location-time {
    color: #666;
    font-size: 0.9rem;
}

.location-coords {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
}

.coord-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.coord-group label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
}

.coord-value {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #333;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
}

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

.map-link, .copy-coords-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.map-link {
    background: #4285f4;
    color: white;
}

.map-link:hover {
    background: #3367d6;
    transform: translateY(-1px);
}

.copy-coords-btn {
    background: #28a745;
    color: white;
    border: none;
    cursor: pointer;
}

.copy-coords-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.no-location-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-location-icon {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 20px;
}

.no-location-message h3 {
    color: #333;
    margin-bottom: 10px;
}

.location-help {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.location-help h4 {
    color: #333;
    margin-bottom: 10px;
}

.location-help ul {
    margin: 0;
    padding-left: 20px;
}

.location-help li {
    margin-bottom: 5px;
    color: #666;
}

.location-info {
    color: #666;
    font-size: 0.9rem;
}

/* Responsive adjustments for location panel */
@media (max-width: 768px) {
    .location-coords {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .location-actions {
        flex-direction: column;
    }
    
    .map-link, .copy-coords-btn {
        justify-content: center;
    }
}


/* WhatsApp Message and Call Styling */
.whatsapp-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.whatsapp-sent {
    background-color: #dcf8c6;
    color: #075e54;
}

.whatsapp-received {
    background-color: #e3f2fd;
    color: #1976d2;
}

.whatsapp-call-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    background-color: #25d366;
    color: white;
}

/* Alternative Location Indicators */
.location-source {
    font-size: 11px;
    color: #666;
    font-style: italic;
}

.location-accuracy {
    font-size: 11px;
    color: #999;
}

