/**
 * Schema Checker Public Styles
 */

/* Container */
.schema-checker-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header */
.schema-checker-header {
    text-align: center;
    margin-bottom: 30px;
}

.schema-checker-header h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

.schema-checker-header p {
    color: #666;
    font-size: 16px;
}

/* Form */
.schema-checker-form {
    background: #f7f7f7;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.schema-url-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.schema-url-input:focus {
    outline: none;
    border-color: #2271b1;
}

.schema-check-button {
    background: #2271b1;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.schema-check-button:hover {
    background: #1a5490;
}

.schema-check-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading */
.schema-loading {
    text-align: center;
    padding: 40px;
}

.schema-loading .spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Results */
.schema-results {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.result-header {
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.result-header h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.result-header a {
    color: #2271b1;
    text-decoration: none;
}

.result-header a:hover {
    text-decoration: underline;
}

/* Schema Types */
.schema-types-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.schema-type-badge {
    display: inline-block;
    background: #2271b1;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.no-types {
    color: #dc3232;
    font-style: italic;
}

/* Result Content */
.result-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

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

/* Schemas Section */
.schemas-section h4,
.recommendations-section h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
}

/* Schema Item */
.schema-item {
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
}

.schema-header {
    background: #e7e7e7;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schema-type {
    font-weight: 600;
    color: #2271b1;
}

.schema-actions {
    display: flex;
    gap: 8px;
}

.schema-actions button {
    background: white;
    border: 1px solid #ccc;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.schema-actions button:hover {
    background: #f0f0f0;
    border-color: #999;
}

.copy-schema.copied {
    background: #46b450;
    color: white;
    border-color: #46b450;
}

/* Validation */
.schema-validation {
    padding: 12px 16px;
    border-top: 1px solid #ddd;
}

.validation-errors,
.validation-warnings {
    margin-bottom: 10px;
}

.validation-errors {
    color: #dc3232;
}

.validation-warnings {
    color: #ffb900;
}

.validation-errors ul,
.validation-warnings ul {
    margin: 5px 0 0 20px;
    list-style: disc;
}

/* Schema Details */
.schema-details {
    padding: 16px;
    border-top: 1px solid #ddd;
    background: white;
}

.schema-properties {
    margin-bottom: 20px;
}

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

.properties-table th {
    background: #f1f1f1;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #ddd;
}

.properties-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    vertical-align: top;
}

.properties-table tr:nth-child(even) td {
    background: #f9f9f9;
}

/* Code Display */
.schema-code pre {
    background: #23282d;
    color: #f1f1f1;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

/* Recommendations */
.recommendations-content {
    background: #f0f8ff;
    border: 1px solid #2271b1;
    border-radius: 6px;
    padding: 20px;
    line-height: 1.6;
}

.recommendations-content p {
    margin: 0 0 15px 0;
}

.recommendations-content p:last-child {
    margin: 0;
}

.recommendations-content ul,
.recommendations-content ol {
    margin: 0 0 15px 20px;
}

.recommendations-content code {
    background: #e1e1e1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 14px;
}

.recommendations-content pre {
    background: #23282d;
    color: #f1f1f1;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

/* Footer Info */
.schema-checker-footer {
    margin-top: 40px;
    padding: 30px;
    background: #f7f7f7;
    border-radius: 8px;
}

.schema-info h3 {
    color: #333;
    margin: 0 0 15px 0;
}

.schema-info h4 {
    color: #666;
    margin: 20px 0 10px 0;
}

.schema-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.schema-info ul {
    margin-left: 20px;
    color: #666;
}

.schema-info li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.schema-info strong {
    color: #333;
}

/* Responsive Design */
@media (max-width: 600px) {
    .form-group {
        flex-direction: column;
    }
    
    .schema-check-button {
        width: 100%;
    }
    
    .schema-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .schema-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Regeneration Buttons */
.regeneration-buttons {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.regenerate-schema-public {
    display: inline-block;
    margin: 5px;
    padding: 10px 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.regenerate-schema-public:hover {
    background: #1976D2;
}

.regenerate-schema-public:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Improved Schema Modal */
.schema-checker-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.schema-checker-modal .modal-content {
    background: white;
    margin: 2% auto;
    padding: 30px;
    width: 90%;
    max-width: 1000px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #000;
}

.improvement-explanation {
    background: #f0f8ff;
    border: 1px solid #2196F3;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 25px;
}

.improvement-explanation h3 {
    margin-top: 0;
    color: #1976D2;
}

.improved-validation-status {
    margin-bottom: 25px;
    padding: 15px;
    border-radius: 4px;
    background: #f9f9f9;
    border: 1px solid #ddd;
}

.improved-validation-status .validation-success {
    color: #4CAF50;
    font-weight: bold;
    font-size: 16px;
}

.improved-validation-status .validation-errors {
    color: #f44336;
    margin-bottom: 10px;
}

.improved-validation-status .validation-warnings {
    color: #ff9800;
}

.improved-schema-section {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 4px;
}

.improved-schema-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.copy-improved-schema {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 15px;
    font-size: 14px;
    transition: background 0.3s;
}

.copy-improved-schema:hover {
    background: #45a049;
}

.improved-schema-code {
    background: white;
    display: block;
    overflow-x: auto;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .schema-checker-modal .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }
    
    .regeneration-buttons {
        text-align: left;
    }
    
    .regenerate-schema-public {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
}