/**
 * PyOCMF Browser Demo Styles
 */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --code-bg: #f1f5f9;
}

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

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.95;
}

.subtitle {
    font-size: 0.9rem !important;
    opacity: 0.8 !important;
    margin-top: 0.5rem;
}

/* Main Content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 300px);
}

.content-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content-section.hidden {
    display: none;
}

/* Loading Section */
.loading-container {
    text-align: center;
    padding: 3rem 0;
}

.progress-bar-container {
    width: 100%;
    max-width: 600px;
    height: 30px;
    background-color: var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    margin: 1.5rem auto;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, #3b82f6 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.info-text {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Input Section */
.input-methods {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.method-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    color: var(--secondary-color);
    transition: all 0.2s;
}

.method-tab:hover {
    color: var(--primary-color);
}

.method-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.input-method {
    margin-top: 1rem;
}

.input-method.hidden {
    display: none;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea {
    resize: vertical;
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
}

.file-input {
    padding: 0.5rem !important;
}

.help-text {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

/* Verification Input */
.verification-input {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.verification-input h3 {
    margin-bottom: 1rem;
}

.public-key-input {
    font-family: "Courier New", monospace;
    font-size: 0.85rem;
}

/* Result Section */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.result-content {
    margin-top: 1.5rem;
}

.result-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-color);
    border-radius: 6px;
}

.result-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.info-table td:first-child {
    width: 30%;
    color: var(--secondary-color);
}

.readings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.readings-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
}

.readings-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.readings-table tbody tr:hover {
    background-color: var(--bg-color);
}

.signature-data {
    font-family: "Courier New", monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.export-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.export-buttons button {
    padding: 0.5rem 1rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.export-buttons button:hover {
    background-color: #475569;
}

/* XML Entry */
.xml-entry {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.xml-entry h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.public-key {
    background-color: var(--code-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: "Courier New", monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.status-badge.valid {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.invalid {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.warning {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.unknown {
    background-color: #e2e8f0;
    color: #475569;
}

.status-badge.error {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Compliance Issues List */
.issues-list {
    list-style: none;
    margin-top: 1rem;
    padding: 0;
}

.issues-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.issues-list li:last-child {
    border-bottom: none;
}

.issues-list li.error {
    color: #991b1b;
}

.issues-list li.warning {
    color: #92400e;
}

/* Entry count */
.entry-count {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

/* XML Entry styling */
.xml-entry {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.xml-entry h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.xml-entry .result-section {
    margin-bottom: 1rem;
}

/* Error Section */
.error-container {
    text-align: center;
    padding: 3rem 0;
}

.error-message {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 1.5rem;
    border-radius: 6px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--error-color);
}

/* Info Section */
.info-section {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.info-section h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.info-section h3:first-child {
    margin-top: 0;
}

.info-section ul {
    list-style-position: inside;
    margin-left: 1rem;
}

.info-section li {
    margin-bottom: 0.5rem;
}

.info-section a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-section a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: var(--text-color);
    color: white;
    padding: 1.5rem 0;
    text-align: center;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

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

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .content-section {
        padding: 1.5rem;
    }

    .result-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .button-group,
    .export-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
