/* IFConverter Web Demo Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

/* Page container */
.page-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Full-width page header */
.page-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f8f8;
    border-bottom: 1px solid #ddd;
    position: relative;
}

.header-logo {
    height: 2rem;
    width: auto;
    position: absolute;
    left: 1rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

/* Content container (holds both panels) */
.content-container {
    display: flex;
    flex: 1;
    gap: 1px;
    background: #ddd;
    min-height: 0;
}

/* Section headers (for Eventlog and IFConverterlist) */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f8f8f8;
    border-bottom: 1px solid #ddd;
    min-height: 2.5rem;
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.section-header button {
    padding: 0.35rem 0.75rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.section-header button:hover {
    background: #0056b3;
}

/* Left Panel: Event Log */
.event-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    min-width: 0;
}

.event-log-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

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

thead {
    position: sticky;
    top: 0;
    background: #f8f8f8;
}

th, td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    font-weight: 600;
    font-size: 0.8rem;
    color: #666;
    border-bottom: 2px solid #ddd;
}

td {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 0.8rem;
}

/* Compact column widths */
.col-time {
    width: 6em;
    white-space: nowrap;
}

.col-reader {
    width: 8ch;
    white-space: nowrap;
}

.col-action {
    width: auto;
    text-align: right;
}

thead button {
    padding: 0.35rem 0.75rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

thead button:hover {
    background: #0056b3;
}

tbody tr:hover {
    background: #f8f8f8;
}

/* Error rows in event log */
tr.error td {
    color: #dc3545;
    background: #fff5f5;
}

tr.error:hover td {
    background: #ffe5e5;
}

/* Right Panel: Reader List */
.reader-panel {
    width: min(25%, 350px);
    min-width: 180px;
    background: #e3f2fd;
    display: flex;
    flex-direction: column;
}

#reader-list {
    padding: 1rem;
    overflow-y: auto;
}

.section {
    margin-bottom: 1.5rem;
}

.section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.reader {
    position: relative;
    padding: 0.75rem;
    padding-right: 2rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: background 0.2s, transform 0.1s;
    background: #ffffff;
    border-left: 3px solid #6c757d;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.reader:hover {
    transform: translateX(2px);
    background: #f0f0f0;
}

/* Serial number */
.reader .snr {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
}

/* Badge base */
.badge {
    display: inline-block;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Badge colors */
.badge-authorized {
    background: #28a745;
    color: white;
}

.badge-pending {
    background: #ffc107;
    color: #333;
}

.badge-failure {
    background: #dc3545;
    color: white;
}

.badge-unknown {
    background: #007bff;
    color: white;
}

/* Action links */
.auth-link {
    color: #007bff;
    cursor: pointer;
    font-size: 0.75rem;
    text-decoration: underline;
}

/* Remove link (always visible, right-aligned) */
.remove-link {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
}

.remove-link:hover {
    color: #000;
    cursor: pointer;
}

.empty {
    color: #999;
    font-style: italic;
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

/* Config download section */
.config-download-section {
    padding: 1rem;
    border-top: 1px solid #ccc;
    margin-top: auto;
    font-size: 0.85rem;
    color: #555;
}

.config-download-section p {
    margin-bottom: 0.5rem;
}

.config-link {
    color: #007bff;
    text-decoration: underline;
    font-weight: 500;
}

/* Device hints */
.device-hint {
    font-size: 0.75rem;
    color: #666;
    font-style: italic;
    width: 100%;
    margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 600px) {
    .content-container {
        flex-direction: column-reverse;
    }

    .reader-panel {
        width: 100%;
        min-width: 100%;
        max-height: 40vh;
        border-bottom: 1px solid #ddd;
    }

    .event-panel {
        flex: 1;
        min-height: 0;
    }
}
