/* Curriculum Browser Example Styles */

* {
    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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    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.2rem;
    opacity: 0.9;
}

.example-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.example-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 1.1rem;
}

select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

select:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.6;
}

.info-panel {
    margin-top: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #2c3e50;
}

.tree-container, .sparql-display, .api-response {
    margin-top: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
    min-height: 100px;
}

/* Enhanced response containers with overflow */
.api-response {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
}

/* Query History Styles */
.query-entry {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.query-entry:last-child {
    margin-bottom: 0;
}

.query-timestamp {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.query-description {
    font-size: 14px;
    color: #34495e;
    font-weight: 500;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #ecf0f1;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.query-content {
    margin: 0;
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
    border: 1px solid #34495e;
}

.query-content code {
    font-family: inherit;
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

.placeholder {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    margin: 20px 0;
}

.tree-node {
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 6px;
    background: white;
    border: 1px solid #e1e8ed;
    transition: all 0.2s ease;
}

.tree-node:hover {
    background: #f1f2f6;
    border-color: #3498db;
}

.tree-node.expanded {
    background: #e8f4fd;
    border-color: #3498db;
}

.tree-toggle {
    cursor: pointer;
    margin-right: 8px;
    color: #3498db;
    font-weight: bold;
}

.tree-content {
    display: inline;
}

.tree-children {
    margin-left: 24px;
    margin-top: 8px;
    border-left: 2px solid #e1e8ed;
    padding-left: 16px;
}

.tree-children.hidden {
    display: none;
}

.sparql-query {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid #34495e;
}

.sparql-query .keyword {
    color: #e74c3c;
    font-weight: bold;
}

.sparql-query .uri {
    color: #f39c12;
}

.sparql-query .variable {
    color: #9b59b6;
}

.api-json {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    overflow-x: auto;
    margin: 10px 0;
    white-space: pre-wrap;
}

/* API Response sections within query entries */
.api-response-section {
    margin-top: 15px;
    border-top: 1px solid #e1e8ed;
    padding-top: 15px;
}

.response-header {
    font-size: 14px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #27ae60;
}

/* Limit response height to about 12 lines */
.api-response-section .api-json {
    max-height: 240px;
    overflow-y: auto;
    overflow-x: auto;
}

details {
    margin-top: 15px;
}

details summary {
    cursor: pointer;
    padding: 12px;
    background: #3498db;
    color: white;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s ease;
}

details summary:hover {
    background: #2980b9;
}

details pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    overflow-x: auto;
    font-size: 14px;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

.error {
    background: #ffeaea;
    border: 1px solid #e74c3c;
    color: #c0392b;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
}

.success {
    background: #eaffea;
    border: 1px solid #27ae60;
    color: #229954;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .example-section {
        padding: 20px;
    }

    select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
