/* SatTracker Pro WordPress Plugin Styles */

#sattracker-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    background: #2a2a2a;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999999;
    display: flex;
    flex-direction: column;
}

/* Header */
.sattracker-header {
    background: linear-gradient(135deg, #1976D2, #1565C0);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sattracker-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sattracker-title h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.sattracker-icon {
    width: 32px;
    height: 32px;
}

.sattracker-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Content */
.sattracker-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

/* Desktop optimization */
@media (min-width: 1200px) {
    .sattracker-content {
        grid-template-columns: 360px 1fr;
    }
}

@media (min-width: 1600px) {
    .sattracker-content {
        grid-template-columns: 400px 1fr;
    }
}

@media (max-width: 768px) {
    .sattracker-content {
        grid-template-columns: 1fr;
    }
}

/* Device Panel */
.sattracker-panel {
    background: #383838;
    border-right: 1px solid #555;
    padding: 1rem;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

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

.panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-success {
    padding: 0.5rem 0.875rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    min-height: 36px;
}

.btn-primary {
    background: #1976D2;
    color: white;
}

.btn-primary:hover {
    background: #1565C0;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-primary svg, .btn-secondary svg, .btn-success svg {
    width: 16px;
    height: 16px;
}

/* Forms */
.device-form {
    background: #4a4a4a;
    border: 1px solid #666;
    border-radius: 6px;
    padding: 0.875rem;
    margin-bottom: 1rem;
}

.device-form h4 {
    margin: 0 0 1rem 0;
    color: #fff;
    font-size: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #ddd;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #666;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
    background: #5a5a5a;
    color: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #1976D2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.form-buttons {
    display: flex;
    gap: 0.5rem;
}

.form-buttons .btn-primary {
    flex: 1;
}

/* Devices List */
.devices-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 1rem;
}

.no-devices {
    text-align: center;
    padding: 2rem;
    color: #ccc;
}

.no-devices svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-devices p {
    margin: 0.5rem 0;
    font-weight: 500;
}

.no-devices small {
    color: #999;
    font-size: 0.8rem;
}

.device-item {
    background: #4a4a4a;
    border: 1px solid #666;
    border-radius: 6px;
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.device-item:hover {
    border-color: #1976D2;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.1);
}

.device-item.selected {
    border-color: #1976D2;
    background: rgba(25, 118, 210, 0.05);
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.device-name {
    font-weight: 600;
    color: #fff;
    margin: 0;
    font-size: 1.1rem;
}

.device-status {
    background: #28a745;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.device-info {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.5;
    margin-top: 0.5rem;
}

.device-info div {
    margin-bottom: 0.25rem;
}

.device-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.device-controls button {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

/* Map Container */
.sattracker-map-container {
    position: relative;
    background: #f0f0f0;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#sattracker-map {
    width: 100% !important;
    height: 100% !important;
    min-height: 600px !important;
    flex: 1;
}

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

.map-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.map-btn:hover {
    background: #f5f5f5;
    border-color: #1976D2;
}

/* Map Overlay */
.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.overlay-content {
    text-align: center;
    color: white;
}

.overlay-content svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.overlay-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.overlay-content p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Loading States */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .sattracker-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .sattracker-panel {
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #555;
    }
    
    .devices-list {
        max-height: 200px;
    }
    
    .sattracker-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 0.75rem;
    }
    
    .sattracker-title h2 {
        font-size: 1.2rem;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .device-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .map-controls {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .map-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

/* Close button for fullscreen */
.close-fullscreen {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.close-fullscreen:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Leaflet marker customization */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

/* Custom marker pulse animation */
@keyframes markerPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}