/* BinkTest Custom Styles */

:root {
    --fidonet-blue: #0066cc;
    --fidonet-green: #009900;
    --fidonet-red: #cc0000;
    --fidonet-orange: #ff6600;
    --text-color: #000000;
    --text-color-muted: #6c757d;
    --message-bg: #ffffff;
    --message-quote-bg: #f8f9fa;
    --message-quote-border: #dee2e6;
    --border-color: #dee2e6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}


.navbar-brand {
    font-weight: bold;
}

.navbar-brand i {
    margin-right: 8px;
}

.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid var(--fidonet-blue);
    font-weight: 600;
}

.message-item {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
    transition: background-color 0.2s;
}

.message-item:hover {
    background-color: #f8f9fa;
}

.message-item:last-child {
    border-bottom: none;
}

.message-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 4px;
}

.message-from {
    font-weight: 600;
    color: var(--fidonet-blue);
}

.message-date {
    font-size: 0.875em;
    color: #6c757d;
}

.message-subject {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.message-origin {
    font-size: 0.8em;
    color: #6c757d;
    font-style: italic;
}

.fidonet-address {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Table-based message list styles */
.message-table {
    border: none;
}

.message-table thead th {
    background-color: var(--fidonet-blue);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 12px 8px;
    vertical-align: middle;
}

.message-table tbody td {
    border-top: 1px solid #eee;
    padding: 12px 8px;
    vertical-align: top;
}

.message-row {
    transition: background-color 0.2s ease;
}

.message-row:hover {
    background-color: #f8f9fa;
}

/* Override Bootstrap table-hover to preserve text colors */
.table-hover > tbody > tr:hover > * {
    color: inherit !important;
}

.table-hover > tbody > tr:hover {
    background-color: #f8f9fa !important;
}

.message-table .message-from {
    font-weight: 600;
    color: var(--fidonet-blue);
}

.message-table .message-address {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.message-table .message-subject {
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.message-table .message-date {
    font-size: 0.875rem;
    color: #6c757d;
    white-space: nowrap;
}

.message-table .echoarea-tag {
    background-color: var(--fidonet-orange);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Responsive table adjustments */
@media (max-width: 768px) {
    .message-table thead th {
        font-size: 0.75rem;
        padding: 8px 4px;
    }
    
    .message-table tbody td {
        padding: 8px 4px;
        font-size: 0.875rem;
    }
    
    .message-table .message-subject {
        font-size: 0.875rem;
    }
}

.echoarea-tag {
    background-color: var(--fidonet-green);
    color: white;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
}

.netmail-indicator {
    background-color: var(--fidonet-red);
    color: white;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 10px;
}

.compose-form {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.compose-form .form-label {
    font-weight: 600;
    color: #495057;
}

.compose-form textarea {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
}

.btn-fidonet {
    background-color: var(--fidonet-blue);
    border-color: var(--fidonet-blue);
    color: white;
}

.btn-fidonet:hover {
    background-color: #0056b3;
    border-color: #004085;
    color: white;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background-color: var(--fidonet-green);
}

.status-offline {
    background-color: #6c757d;
}

.status-error {
    background-color: var(--fidonet-red);
}

.node-list .card-body {
    padding: 0;
}

.node-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.node-item:hover {
    background-color: var(--message-bg);
}

.node-item:last-child {
    border-bottom: none;
}

.node-address {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--fidonet-blue);
}

.node-system {
    font-weight: 500;
    margin-bottom: 2px;
}

.node-sysop {
    color: #6c757d;
    font-size: 0.9em;
}

.footer {
    margin-top: auto;
    padding: 20px 0;
    background-color: #e9ecef;
    border-top: 1px solid #dee2e6;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #6c757d;
}

.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin: 10px 0;
}

.success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Kludge lines styling */
.kludge-lines {
    font-family: 'Courier New', monospace;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--kludge-bg);
}

.kludge-lines pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--kludge-text);
    background-color: var(--kludge-bg);
    line-height: 1.3;
}

.message-headers {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.message-headers h6 {
    color: #495057;
    font-weight: 600;
}

#toggleHeaders {
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

#toggleHeaders:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* Animation for kludge line toggle */
#kludgeContainer {
    overflow: hidden;
    transition: height 0.3s ease;
}

/* Kludge line color coding legend (for reference in comments)
 * MSGID: #28a745 (Green) - Message ID
 * REPLY: #17a2b8 (Info/Blue) - Reply ID
 * INTL: #ffc107 (Warning/Yellow) - International routing
 * TOPT/FMPT: #fd7e14 (Orange) - To/From points
 * PID: #e83e8c (Pink) - Product ID
 * SEEN-BY: #6f42c1 (Purple) - Seen by nodes
 * PATH: #20c997 (Teal) - Message path
 * Origin: #6c757d (Gray, Italic) - Origin line
 * Tearline: #adb5bd (Light gray) - Tearline
 * Generic: #dc3545 (Red) - Other kludge lines
 * Text: #f8f9fa (Light) - Regular text
 */

/* Echo area management styles */
.echoarea-color-selector {
    border-radius: 4px;
    transition: border-left 0.2s ease;
}

.color-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .message-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .message-date {
        margin-top: 4px;
    }
    
    .compose-form {
        padding: 15px;
    }
    
    .message-headers {
        padding: 10px;
    }
    
    .kludge-lines pre {
        font-size: 0.8rem;
    }
    
    #toggleHeaders {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

/* Mobile-friendly message formatting */
.message-formatted {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-paragraph {
    margin-bottom: 0.75rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.message-line {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    display: inline;
}

.message-quote {
    border-left: 3px solid var(--message-quote-border);
    padding-left: 1rem;
    margin: 1rem 0;
    background-color: var(--message-quote-bg);
    border-radius: 0 0.25rem 0.25rem 0;
}

.quote-line {
    margin-bottom: 0.25rem;
    color: var(--text-color-muted);
    font-style: italic;
}

.message-signature {
    color: var(--text-color-muted);
    font-size: 0.9em;
    margin-bottom: 0.5rem;
}

.message-signature-separator {
    color: var(--text-color-muted);
    margin: 1rem 0 0.5rem 0;
    font-family: monospace;
}

.message-preformatted {
    background-color: var(--message-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'Courier New', Monaco, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: auto;
    color: var(--text-color);
}

/* Legacy message text styles - enhanced for mobile */
.message-text pre {
    background-color: var(--message-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'Courier New', Monaco, Consolas, monospace;
    font-size: 16px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: auto;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .message-formatted {
        font-size: 16px;
        line-height: 1.5;
    }
    
    .message-paragraph {
        margin-bottom: 1rem;
    }
    
    .message-quote {
        padding-left: 0.75rem;
        margin: 0.75rem 0;
    }
    
    .message-preformatted {
        font-size: 14px;
        padding: 0.75rem;
        border-radius: 0.25rem;
    }
    
    .message-text pre {
        font-size: 14px;
        padding: 0.75rem;
        border-radius: 0.25rem;
    }
    
    .quote-line {
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    .message-formatted {
        font-size: 16px;
        line-height: 1.4;
    }
    
    .message-preformatted {
        font-size: 13px;
        padding: 0.5rem;
    }
    
    .message-text pre {
        font-size: 13px;
        padding: 0.5rem;
    }
    
    .message-quote {
        padding-left: 0.5rem;
        border-left-width: 2px;
    }
}


