/* Xapner PrintBridge Styles */

/* PrintBridge Settings Button */
.printbridge-settings-btn {
    position: fixed;
    bottom: 16px;
    left: 80px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.printbridge-settings-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.printbridge-settings-btn:active {
    transform: scale(0.95);
}

/* PrintBridge Modal */
.printbridge-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

/* Modal Overlay - Click outside to close */
.printbridge-modal-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    cursor: pointer;
}

.printbridge-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
    z-index: 2001;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.printbridge-modal-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.printbridge-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.printbridge-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.printbridge-close:hover {
    background-color: rgba(255,255,255,0.2);
}

.printbridge-modal-body {
    padding: 20px;
}

/* Connection Section */
.printbridge-connection {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.printbridge-connection .btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.printbridge-connection .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.printbridge-connection .btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

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

.printbridge-connection .btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background-color: #28a745;
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
}

.status-dot.disconnected {
    background-color: #dc3545;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
}

.status-text {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-text.connected {
    color: #28a745;
}

.status-text.disconnected {
    color: #dc3545;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Printers Section */
.printbridge-printers {
    margin-bottom: 20px;
}

.printbridge-printers label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.printbridge-printers select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.2s ease;
}

.printbridge-printers select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.printbridge-printers .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.printbridge-printers .btn-sm:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Actions Section */
.printbridge-actions {
    margin-bottom: 20px;
}

.printbridge-actions .btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.printbridge-actions .btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Console Section */
.printbridge-console {
    margin-bottom: 20px;
}

.printbridge-console label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.console-log {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    height: 100px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

.console-log .log-entry {
    margin-bottom: 2px;
    padding: 2px 0;
}

.console-log .log-info {
    color: #333;
}

.console-log .log-success {
    color: #28a745;
    font-weight: 500;
}

.console-log .log-error {
    color: #dc3545;
    font-weight: 500;
}

.console-log .log-warning {
    color: #ffc107;
    font-weight: 500;
}

/* Thermal Print Button */
.thermal-print-btn {
    margin-left: 5px;
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.thermal-print-btn:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    color: #212529;
}

.thermal-print-btn:focus {
    box-shadow: 0 0 0 2px rgba(255,193,7,0.25);
}

/* Responsive Design */
@media (max-width: 768px) {
    .printbridge-modal-content {
        width: 90%;
        margin: 10% auto;
    }
    
    .printbridge-settings-btn {
        width: 44px;
        height: 44px;
        bottom: 10px;
        left: 70px;
        font-size: 16px;
    }
    
    .printbridge-connection {
        flex-direction: column;
        align-items: stretch;
    }
    
    .printbridge-connection .btn {
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .printbridge-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .printbridge-modal-body {
        padding: 15px;
    }
    
    .console-log {
        height: 80px;
        font-size: 11px;
    }
}

/* Print Styles */
@media print {
    .printbridge-settings-btn,
    .printbridge-modal {
        display: none !important;
    }
}

/* Loading Animation */
.printbridge-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

/* Button States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Focus States */
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Smooth Transitions */
* {
    transition: all 0.2s ease;
}

/* Custom Scrollbar for Console */
.console-log::-webkit-scrollbar {
    width: 6px;
}

.console-log::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.console-log::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.console-log::-webkit-scrollbar-thumb:hover {
    background: #555;
}

