/* OBL Demo Styles - Modern, Clean, Responsive */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header Styles */
.header {
    text-align: center;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 20px;
    border-radius: 10px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.2rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.example {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: left;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.example p {
    margin-bottom: 15px;
}

.example code {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
}

.example small {
    display: block;
    margin-top: 5px;
    opacity: 0.8;
    font-size: 0.85rem;
}

/* Controls Section */
.controls {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

#oblCodeInput {
    flex: 1;
    min-width: 300px;
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    transition: border-color 0.2s ease;
}

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

button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#decodeBtn {
    background: #28a745;
    color: white;
}

#decodeBtn:hover {
    background: #218838;
    transform: translateY(-1px);
}

#clearBtn {
    background: #6c757d;
    color: white;
}

#clearBtn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.examples {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.examples-label {
    font-weight: 600;
    color: #666;
    margin-right: 10px;
}

.example-btn {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.example-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

/* Instructions */
.instructions {
    background: #e7f3ff;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    margin-bottom: 20px;
}

.instructions ol {
    margin-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
    color: #495057;
}

/* Map Container */
.map-container {
    height: 60vh;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Status Panel */
.status {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.status-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

#generatedCode {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
    background: #f8f9ff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e0e6ed;
}

#accuracy, #beacons {
    color: #666;
    font-size: 0.9rem;
}

/* Encoding Options Panel */
.encoding-options {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.encoding-options h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.3rem;
}

.options-intro {
    margin: 0 0 20px 0;
    color: #666;
    font-style: italic;
}

.options-list {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.option-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.option-item.primary {
    border-color: #28a745;
    background: #f8fff9;
}

.option-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    flex: 1;
    margin-right: 15px;
}

.option-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.option-method {
    font-size: 0.85rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 2px;
}

.option-accuracy {
    font-size: 0.8rem;
    color: #666;
}

.option-item.method-3beacon .option-method {
    color: #28a745;
}

.option-item.method-2beacon .option-method {
    color: #007bff;
}

.option-item.rounding-precise {
    border-left: 4px solid #28a745;
}

.option-item.rounding-readable {
    border-left: 4px solid #17a2b8;
}

.option-item.rounding-approximate {
    border-left: 4px solid #ffc107;
}

.options-legend {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #e0e6ed;
}

.options-legend p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.legend-item {
    white-space: nowrap;
}

/* Copy feedback */
.option-item.copied {
    border-color: #28a745;
    background: #d4edda;
    animation: copyFeedback 0.6s ease;
}

@keyframes copyFeedback {
    0% { background: #d4edda; }
    50% { background: #c3e6cb; }
    100% { background: #d4edda; }
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    color: #666;
    border-top: 1px solid #e0e6ed;
    margin-top: 30px;
}

.footer a {
    color: #667eea;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Custom Leaflet Popup Styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.beacon-popup {
    text-align: center;
}

.beacon-popup h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.1rem;
}

.beacon-popup p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.beacon-popup .coordinates {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .example {
        padding: 15px;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    #oblCodeInput {
        min-width: auto;
    }
    
    .examples {
        justify-content: center;
    }
    
    .status-panel {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .map-container {
        height: 50vh;
        min-height: 300px;
    }
    
    /* Encoding options responsive */
    .option-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .option-code {
        margin-right: 0;
        font-size: 0.9rem;
        word-break: break-all;
    }
    
    .option-details {
        align-items: flex-start;
        text-align: left;
        width: 100%;
    }
    
    .options-legend .legend-item {
        display: block;
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .example code {
        font-size: 0.8rem;
        word-break: break-all;
    }
    
    .controls {
        padding: 15px;
    }
    
    button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* Animation for loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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