/**
 * Connection Test Styles
 * Glado POS System Installer
 */

/* Connection test containers */
.connection-test-container {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
}

.connection-test-container h5 {
    margin-bottom: 1rem;
    color: #495057;
    font-weight: 600;
}

/* Test button styles */
.test-connection-btn {
    min-width: 140px;
    margin-top: 0.5rem;
}

.test-connection-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.test-connection-btn .fa-spinner {
    margin-right: 0.5rem;
}

/* Status alert styles */
.connection-status {
    margin-top: 1rem;
    display: none;
    border-radius: 0.375rem;
}

.connection-status.show {
    display: block;
}

.connection-status i {
    margin-right: 0.5rem;
}

.connection-status small {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Form validation styles */
.form-control.is-valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94-.94 1.44 1.44L7.4 4.5l.94.94L4.66 9.17z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 1.4 1.4M7.2 4.6l-1.4 1.4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Service toggle styles */
.service-toggle {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #e9ecef;
    border-radius: 0.375rem;
}

.service-toggle .form-check {
    margin-bottom: 0;
}

.service-toggle .form-check-label {
    font-weight: 500;
    color: #495057;
}

/* Optional service config */
.optional-service-config {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px dashed #ced4da;
    border-radius: 0.375rem;
    background-color: #ffffff;
}

.optional-service-config.show {
    display: block;
}

/* Progress indicators */
.connection-progress {
    margin-top: 1rem;
}

.connection-progress .progress {
    height: 0.5rem;
}

.connection-progress .progress-bar {
    transition: width 0.3s ease;
}

/* Test results summary */
.test-results-summary {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
}

.test-results-summary h6 {
    margin-bottom: 1rem;
    color: #495057;
}

.test-result-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f3f4;
}

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

.test-result-icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.test-result-icon.success {
    color: #28a745;
}

.test-result-icon.error {
    color: #dc3545;
}

.test-result-icon.warning {
    color: #ffc107;
}

.test-result-name {
    flex: 1;
    font-weight: 500;
}

.test-result-status {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .connection-test-container {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .test-connection-btn {
        width: 100%;
        margin-top: 0.75rem;
    }
    
    .test-results-summary {
        padding: 1rem;
    }
}

/* Animation for status changes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.connection-status.show {
    animation: fadeIn 0.3s ease-out;
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

/* Tooltip styles for help text */
.connection-help {
    position: relative;
    display: inline-block;
    margin-left: 0.5rem;
}

.connection-help .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 0.375rem;
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.connection-help:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Success/Error message styling */
.connection-status .alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.connection-status .alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.connection-status .alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Button group for multiple test actions */
.test-button-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.test-button-group .btn {
    flex: 1;
}

@media (max-width: 576px) {
    .test-button-group {
        flex-direction: column;
    }
    
    .test-button-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}