/* Vehicle Gateway User Portal Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Navbar Custom Color */
.navbar.bg-dark {
    background-color: #272727 !important;
}

body {
    background-color: #f5f5f5;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Connection Card */
.connection-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    background: white;
}

.connection-info {
    padding: 2rem;
}

.connection-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.connection-info h5 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Configuration Card */
.config-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    background: white;
}

.config-card .card-header {
    background: linear-gradient(135deg, var(--primary-color), #084298);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border: none;
    padding: 1rem 1.25rem;
}

.config-card .card-header h5 {
    margin: 0;
    font-weight: 600;
}

/* Control Card */
.control-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    background: white;
}

.control-card .card-header {
    background: linear-gradient(135deg, var(--secondary-color), #495057);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border: none;
    padding: 1rem 1.25rem;
}

/* Safety Features Section */
.safety-features {
    background: rgba(var(--light-color), 0.5);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.safety-features h6 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
}

/* Feature Toggle Styling */
.feature-toggle {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    margin-bottom: 1rem;
}

.feature-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.feature-toggle .form-check {
    margin-bottom: 0.5rem;
}

.toggle-title {
    font-weight: 600;
    color: var(--dark-color);
}

/* Enhanced Toggle Switches */
.form-switch .form-check-input {
    width: 3.5rem;
    height: 1.75rem;
    border-radius: 1rem;
    background-color: #dee2e6;
    border: 2px solid #dee2e6;
    background-image: none;
    transition: var(--transition);
}

.form-switch .form-check-input:checked {
    background-color: var(--success-color);
    border-color: var(--success-color);
    background-image: none;
}

.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

.form-switch .form-check-input:disabled {
    opacity: 0.5;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    transition: var(--transition);
    padding: 0.875rem 1rem;
    font-size: 1rem;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #084298);
    color: white;
}

.btn-outline-light {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #146c43);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #e0a800);
    color: var(--dark-color);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), #0aa2c0);
    color: var(--dark-color);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #565e64);
}

/* Connection Status Badge */
#connectionStatus {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: var(--transition);
}

#connectionStatus.connected {
    background-color: var(--success-color) !important;
    animation: pulse 2s infinite;
}

#connectionStatus.connecting {
    background-color: var(--warning-color) !important;
    color: var(--dark-color) !important;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(25, 135, 84, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
    }
}

/* OTA Panel */
.ota-panel {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: var(--border-radius);
    border: 2px dashed var(--info-color);
    padding: 1.5rem;
}

.ota-panel h6 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

/* Progress Bar */
.progress {
    border-radius: 10px;
    background-color: #e9ecef;
    height: 12px;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Navbar */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .connection-info {
        padding: 1.5rem;
    }
    
    .connection-icon {
        font-size: 2.5rem;
    }
    
    .feature-toggle {
        padding: 1rem;
    }
    
    .safety-features {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .form-switch .form-check-input {
        width: 3rem;
        height: 1.5rem;
    }
}

@media (max-width: 576px) {
    .row.g-3 > .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .d-grid.gap-2.d-md-flex {
        display: grid !important;
        gap: 0.75rem;
    }
    
    .feature-toggle {
        margin-bottom: 0.75rem;
    }
}

/* Animation for smooth reveals */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Configuration Display Modal */
.config-display {
    text-align: left;
}

.config-display h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-color);
}

.config-display ul li {
    padding: 0.3rem 0;
    font-size: 0.95rem;
}

.config-display .text-success {
    color: var(--success-color) !important;
}

.config-display .text-secondary {
    color: var(--secondary-color) !important;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}