/* Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-indicator {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #94a3b8;
    position: relative;
    transition: all 0.3s ease;
}

.status-led::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

.status-led-inactive {
    background: #94a3b8;
}

.status-led-active {
    background: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.status-led-success {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-led-error {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.1; }
    100% { transform: scale(1); opacity: 0.3; }
}

/* Card Styles */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    background: #ffffff;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 1.25rem 1.5rem;
    border-radius: 12px 12px 0 0 !important;
}

.status-card {
    transition: all 0.3s ease;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.status-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Form Styles */
.form-control {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-control:disabled {
    background-color: #f3f4f6;
    opacity: 0.7;
}

.form-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.form-text {
    font-size: 0.75rem;
    color: #6b7280;
}

.form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.form-switch .form-check-input {
    width: 3rem;
    height: 1.5rem;
}

.form-switch .form-check-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%233b82f6'/%3e%3c/svg%3e");
}

/* Button Styles */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 1px solid #3b82f6;
    color: #3b82f6;
}

.btn-outline-primary:hover {
    background: #3b82f6;
    border-color: #3b82f6;
}

.btn-outline-danger {
    border: 1px solid #ef4444;
    color: #ef4444;
}

.btn-outline-danger:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.btn-outline-secondary {
    border: 1px solid #6b7280;
    color: #6b7280;
}

.btn-outline-secondary:hover {
    background: #6b7280;
    border-color: #6b7280;
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e5e7eb;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Table Styles */
.table {
    font-size: 0.875rem;
}

.table th {
    background-color: #f9fafb;
    color: #374151;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0.75rem;
}

.table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f9fafb;
}

.table-success {
    background-color: rgba(16, 185, 129, 0.05) !important;
}

/* Badge Styles */
.badge {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
}

/* Log Container */
.log-container {
    max-height: 200px;
    overflow-y: auto;
    background: #1f2937;
    color: #f9fafb;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
}

.log-entry {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #374151;
    display: flex;
    align-items: center;
}

.log-time {
    color: #9ca3af;
    margin-right: 1rem;
    min-width: 60px;
}

.log-icon {
    margin-right: 0.5rem;
    min-width: 16px;
}

.log-message {
    flex: 1;
}

.log-info { background-color: rgba(59, 130, 246, 0.1); }
.log-success { background-color: rgba(16, 185, 129, 0.1); }
.log-warning { background-color: rgba(245, 158, 11, 0.1); }
.log-error { background-color: rgba(239, 68, 68, 0.1); }

/* Input Group */
.input-group-text {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    .status-icon {
        width: 50px;
        height: 50px;
    }
    
    .display-4 {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .card-header {
        padding: 0.875rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .form-control {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }
    
    .log-container {
        max-height: 150px;
    }
    
    .log-entry {
        padding: 0.375rem 0.75rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.875rem;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0f172a;
        color: #e2e8f0;
    }
    
    .card {
        background: #1e293b;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    
    .card-header {
        background-color: #1e293b;
        border-bottom-color: #334155;
    }
    
    .form-control {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    .form-control:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }
    
    .table th {
        background-color: #1e293b;
        color: #e2e8f0;
        border-bottom-color: #334155;
    }
    
    .table td {
        border-bottom-color: #334155;
        color: #e2e8f0;
    }
    
    .text-dark {
        color: #e2e8f0 !important;
    }
    
    .text-muted {
        color: #94a3b8 !important;
    }
}