/* styles.css */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 20px;
    background: #f5f5f5;
    line-height: 1.6;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

/* Environment Indicator */
.env-indicator {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    padding: 5px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* API Status Section */
.status-section {
    margin-bottom: 20px;
}

.api-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.api-status-left {
    display: flex;
    align-items: center;
}

.api-status.healthy {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.api-status.unhealthy {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.api-status.checking {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.green { background: #28a745; }
.status-dot.red { background: #dc3545; }
.status-dot.yellow { background: #ffc107; }

/* Refresh Button */
.refresh-btn {
    background: #007bff;
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
}

.refresh-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.refresh-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.refresh-btn.spinning::before {
    content: '↻';
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

/* Developer Panel */
.dev-panel {
    background: #1e1e1e;
    border-radius: 8px;
    margin: 10px 0;
    overflow: hidden;
    display: none;
}

.dev-panel.show {
    display: block;
}

.dev-panel-header {
    background: #2d2d30;
    padding: 12px 15px;
    color: #cccccc;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #404040;
}

.dev-panel-header .title::before {
    content: '⚠️';
    margin-right: 8px;
}

.close-dev-panel {
    background: none;
    border: none;
    color: #cccccc;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
}

.close-dev-panel:hover {
    background: #404040;
}

.dev-panel-content {
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #d4d4d4;
    max-height: 300px;
    overflow-y: auto;
}

.error-section {
    margin-bottom: 15px;
}

.error-label {
    color: #f48771;
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.error-value {
    color: #ce9178;
    margin-left: 10px;
    word-break: break-all;
}

.info-section {
    border-top: 1px solid #404040;
    padding-top: 10px;
    margin-top: 15px;
}

.info-label {
    color: #4ec9b0;
    font-weight: bold;
}

.info-value {
    color: #9cdcfe;
    margin-left: 10px;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.toggle-label {
    font-weight: 500;
    color: #555;
    margin-right: 15px;
    font-size: 16px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:disabled + .slider {
    background-color: #cccccc;
    cursor: not-allowed;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Status and location info */
#status {
    text-align: center;
    margin-bottom: 20px;
    min-height: 25px;
    font-weight: 500;
}

#locationInfo {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.location-entry {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    word-break: break-all;
}

.location-entry:last-child {
    border-bottom: none;
}

.error { color: #dc3545; }
.success { color: #28a745; }
.warning { color: #ffc107; }

/* Mobile responsive */
@media (max-width: 480px) {
    body { padding: 10px; }
    .container { padding: 15px; }
    h2 { font-size: 1.5em; }
    .location-entry { font-size: 12px; }
    .api-status { flex-direction: column; gap: 10px; }
    .api-status-left { justify-content: center; }
    .refresh-btn { min-width: auto; padding: 8px 12px; }
}
