/* Portsolis Print Bridge Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #FE7804 0%, #ff9a4d 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 20px;
    font-weight: 700;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc3545;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #28a745;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Sections */
.section {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.section:last-child {
    border-bottom: none;
}

.section h2 {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 15px;
}

/* Printer Section */
.printer-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.printer-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.label {
    color: #6c757d;
    font-size: 13px;
}

.value {
    color: #212529;
    font-weight: 500;
    font-size: 13px;
}

/* Discovery Info */
.discovery-info {
    margin-top: 15px;
}

.discovery-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 10px;
}

.services-list {
    max-height: 300px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
}

.service-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.service-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.service-uuid {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #007bff;
    font-weight: 600;
    margin-bottom: 8px;
}

.characteristics-list {
    margin-left: 15px;
}

.characteristic-item {
    font-size: 12px;
    margin-bottom: 5px;
    padding: 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.characteristic-uuid {
    font-family: 'Courier New', monospace;
    color: #212529;
    font-weight: 500;
}

.characteristic-props {
    color: #6c757d;
    font-size: 11px;
    margin-top: 3px;
}

.char-prop {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
}

.char-prop.write {
    background: #d4edda;
    color: #155724;
}

.char-prop.writeWithoutResponse {
    background: #d1ecf1;
    color: #0c5460;
}

.char-prop.read {
    background: #fff3cd;
    color: #856404;
}

.char-prop.notify {
    background: #f8d7da;
    color: #721c24;
}

.char-prop.indicate {
    background: #e2e3e5;
    color: #383d41;
}

.writable-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #28a745;
    color: white;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #FE7804;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #e56a00;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

/* Receipt Preview */
.receipt-preview {
    margin-top: 15px;
}

.receipt-preview h3 {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 10px;
}

.receipt-content {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-width: 280px;
    margin: 0 auto;
}

.receipt-header {
    text-align: center;
    margin-bottom: 15px;
}

.receipt-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.receipt-subtitle {
    font-size: 12px;
    color: #6c757d;
}

.receipt-divider {
    border-top: 1px dashed #000;
    margin: 10px 0;
}

.receipt-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.receipt-line.total {
    font-weight: bold;
    margin-top: 10px;
}

.receipt-date {
    text-align: center;
    font-size: 11px;
    color: #6c757d;
    margin-top: 15px;
}

/* Activity Log */
.activity-log {
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
}

.activity-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
}

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

.activity-time {
    color: #6c757d;
    font-size: 11px;
    min-width: 80px;
}

.activity-message {
    color: #212529;
    flex: 1;
}

.activity-item.error .activity-message {
    color: #dc3545;
}

.activity-item.success .activity-message {
    color: #28a745;
}

.activity-item.info .activity-message {
    color: #007bff;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .printer-controls {
        flex-direction: column;
    }
}
