/**
 * Estilos CSS Premium para Panel de ConfiguraciÃ³n IoT
 * DiseÃ±o Glassmorphism con animaciones y gradientes
 */

/* ============================================================================
   MODAL Y CONTENEDOR PRINCIPAL
   ============================================================================ */

#iot-config-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#iot-config-modal.active {
    display: flex;
    opacity: 1;
}

.iot-config-panel {
    max-width: 1400px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(18, 18, 35, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.iot-config-header {
    padding: 24px 32px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.iot-config-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.iot-config-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.iot-config-header h2 i {
    font-size: 28px;
    color: #818cf8;
}

/* ============================================================================
   SELECTOR DE DISPOSITIVO
   ============================================================================ */

.device-selector {
    display: flex;
    gap: 16px;
    align-items: center;
}

.device-select {
    flex: 1;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.device-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

.device-select option {
    background: #1a1a2e;
    color: #fff;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-online {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
    animation: pulse-online 2s ease-in-out infinite;
}

.status-warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-offline {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-unknown {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

@keyframes pulse-online {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ============================================================================
   BODY Y GRID LAYOUT
   ============================================================================ */

.iot-config-body {
    padding: 24px 32px;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* ============================================================================
   CARDS DE CONFIGURACIÃ“N
   ============================================================================ */

.config-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.config-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.config-card .card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.card-interval .card-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.card-thresholds .card-header {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(251, 191, 36, 0.05) 100%);
}

.card-gps .card-header {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
}

.card-commands .card-header {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(168, 85, 247, 0.05) 100%);
}

.config-card .card-header i {
    font-size: 24px;
}

.card-interval .card-header i {
    color: #818cf8;
}

.card-thresholds .card-header i {
    color: #fbbf24;
}

.card-gps .card-header i {
    color: #22c55e;
}

.card-commands .card-header i {
    color: #a855f7;
}

.config-card .card-header h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.config-card .card-body {
    padding: 20px;
}

/* ============================================================================
   SLIDER PERSONALIZADO
   ============================================================================ */

.slider-container {
    margin-bottom: 20px;
}

.slider-container label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-bottom: 12px;
    font-weight: 500;
}

.custom-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: all 0.2s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
}

.slider-value {
    text-align: center;
    margin-top: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #818cf8;
}

/* ============================================================================
   INPUTS Y CONTROLES
   ============================================================================ */

.threshold-group {
    margin-bottom: 16px;
}

.threshold-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 500;
}

.threshold-group input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.threshold-group input[type="number"]:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-with-unit input {
    flex: 1;
}

.input-with-unit span {
    color: #fbbf24;
    font-weight: 600;
    min-width: 50px;
}

/* ============================================================================
   TOGGLE SWITCHES
   ============================================================================ */

.toggle-group {
    margin-bottom: 16px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
}

.toggle-input:checked+.toggle-slider {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.toggle-input:checked+.toggle-slider::before {
    transform: translateX(24px);
}

.toggle-text {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================================================
   BOTONES
   ============================================================================ */

.btn-primary {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.quick-commands {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.btn-command {
    padding: 14px;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.btn-command i {
    font-size: 24px;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-command:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   LOG DE COMANDOS
   ============================================================================ */

.command-log-panel {
    margin-top: 24px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
}

.log-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.log-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.log-header i {
    color: #818cf8;
}

.btn-link {
    background: transparent;
    border: none;
    color: #818cf8;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-link:hover {
    color: #a5b4fc;
}

.command-log {
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
}

.log-entry {
    display: grid;
    grid-template-columns: 80px 140px 1fr 100px;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    font-size: 12px;
    align-items: center;
    transition: all 0.2s ease;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.05);
}

.log-time {
    color: rgba(255, 255, 255, 0.5);
}

.log-command {
    color: #818cf8;
    font-weight: 600;
}

.log-details {
    color: rgba(255, 255, 255, 0.7);
}

.log-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    font-size: 11px;
}

.status-sent {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.status-ack {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-failed {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.status-info {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

/* ============================================================================
   SCROLLBAR PERSONALIZADO
   ============================================================================ */

.iot-config-body::-webkit-scrollbar,
.command-log::-webkit-scrollbar {
    width: 8px;
}

.iot-config-body::-webkit-scrollbar-track,
.command-log::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.iot-config-body::-webkit-scrollbar-thumb,
.command-log::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.iot-config-body::-webkit-scrollbar-thumb:hover,
.command-log::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 1200px) {
    .config-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .config-grid {
        grid-template-columns: 1fr;
    }

    .log-entry {
        grid-template-columns: 70px 1fr;
        gap: 8px;
    }

    .log-command,
    .log-status {
        grid-column: 2;
    }
}/ *   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  
       N O T I F I C A C I O N E S   ( T O A S T )  
       = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   * /  
  
 . i o t - n o t i f i c a t i o n   {  
         p o s i t i o n :   f i x e d ;  
         b o t t o m :   2 4 p x ;  
         r i g h t :   2 4 p x ;  
         p a d d i n g :   1 6 p x   2 4 p x ;  
         b o r d e r - r a d i u s :   1 2 p x ;  
         b a c k g r o u n d :   r g b a ( 3 0 ,   4 1 ,   5 9 ,   0 . 9 5 ) ;  
         b a c k d r o p - f i l t e r :   b l u r ( 1 0 p x ) ;  
         c o l o r :   # f f f ;  
         f o n t - s i z e :   1 4 p x ;  
         f o n t - w e i g h t :   5 0 0 ;  
         b o x - s h a d o w :   0   1 0 p x   3 0 p x   r g b a ( 0 ,   0 ,   0 ,   0 . 5 ) ,   0   0   0   1 p x   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 1 ) ;  
         t r a n s f o r m :   t r a n s l a t e Y ( 1 0 0 p x ) ;  
         o p a c i t y :   0 ;  
         t r a n s i t i o n :   a l l   0 . 4 s   c u b i c - b e z i e r ( 0 . 1 7 5 ,   0 . 8 8 5 ,   0 . 3 2 ,   1 . 2 7 5 ) ;  
         z - i n d e x :   1 0 0 0 0 0 ;  
         / *   S u p e r a r   a l   m o d a l   * /  
         d i s p l a y :   f l e x ;  
         a l i g n - i t e m s :   c e n t e r ;  
         g a p :   1 2 p x ;  
         b o r d e r - l e f t :   4 p x   s o l i d   # 3 b 8 2 f 6 ;  
 }  
  
 . i o t - n o t i f i c a t i o n . s h o w   {  
         t r a n s f o r m :   t r a n s l a t e Y ( 0 ) ;  
         o p a c i t y :   1 ;  
 }  
  
 . i o t - n o t i f i c a t i o n . s u c c e s s   {  
         b o r d e r - l e f t - c o l o r :   # 2 2 c 5 5 e ;  
 }  
  
 . i o t - n o t i f i c a t i o n . s u c c e s s : : b e f o r e   {  
         c o n t e n t :   ' â S ' ;  
         c o l o r :   # 2 2 c 5 5 e ;  
         f o n t - w e i g h t :   9 0 0 ;  
 }  
  
 . i o t - n o t i f i c a t i o n . e r r o r   {  
         b o r d e r - l e f t - c o l o r :   # e f 4 4 4 4 ;  
 }  
  
 . i o t - n o t i f i c a t i o n . e r r o r : : b e f o r e   {  
         c o n t e n t :   ' ! ' ;  
         c o l o r :   # e f 4 4 4 4 ;  
         f o n t - w e i g h t :   9 0 0 ;  
 }  
  
 . i o t - n o t i f i c a t i o n . w a r n i n g   {  
         b o r d e r - l e f t - c o l o r :   # f 5 9 e 0 b ;  
 }  
  
 . i o t - n o t i f i c a t i o n . w a r n i n g : : b e f o r e   {  
         c o n t e n t :   ' â a  ' ;  
         c o l o r :   # f 5 9 e 0 b ;  
         f o n t - w e i g h t :   9 0 0 ;  
 }  
 