/***********************************************
 * 1) RESET & BASE STYLES
 ***********************************************/

/* Reset básico */

:root {
    --primary: #2f97ff;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --gray: #9c9c9c;
    --shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.6);
    --transition: all 0.3s ease;
}

html {
    font-size: 85%;
}

@font-face {
    font-family: 'Jockey One';
    src: url('../fontes/JockeyOne-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #9c9c9c9c;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/***********************************************
 * 2) BACKGROUND ANIMATION (LOGIN/BACKGROUND)
 ***********************************************/
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/back vetor.jpg');
    background-size: cover;
    background-position: center;
    animation: zoomAnimation 30s ease-in-out infinite;
    z-index: -1;
}

@keyframes zoomAnimation {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/***********************************************
 * 3) FORMULÁRIO (LOGIN/REGISTRO)
 ***********************************************/
.form {
    width: 100%;
    max-width: 500px;
    margin: auto;
    padding-top: 50px;
    padding: 50px 30px 30px;
}

.card {
    box-shadow: 5px 5px 10px #000000;
    background-color: #07092257;
    padding: 30px;
    border-radius: 8px;
}

.frame-top {
    text-align: center;
}

.frame-group {
    margin-bottom: 15px;
}

.frame-group > label {
    width: 100%;
    color: hsl(0, 0%, 100%);
    display: block;
    text-shadow: var(--shadow);
}

.frame-group > input {
    border-radius: 5px;
    outline: 0;
    width: 100%;
    height: 40px;
    padding: 10px;
}

.frame-group > button {
    background: linear-gradient(0deg, #1559f8 0%, #489de2 100%);
    width: 100%;
    height: 50px;
    border-radius: 5px;
    padding: 10px 25px;
    color: #fff;
    font-family: "Lato", sans-serif;
    font-weight: 500;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.frame-group > button:hover {
    box-shadow: var(--shadow-hover);
    background-image: linear-gradient(to right, #1559f8, #489de2);
}

.ico {
    box-shadow: 0px 0px 30px #000;
}

.title,
.subtitle {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 0, 0, 1);
}

/***********************************************
 * 4) MODAL LOGIN
 ***********************************************/

.modallogin {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 1);
}

.modallogin-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 1);
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

.forgot-password {
    text-align: center;
    margin-top: 10px;
}

.forgot-password a {
    color: #007bff;
    cursor: pointer;
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/***********************************************
 * 5) NAVBAR (TOPO FIXO)
 ***********************************************/
.navbar-text {
    color: #ffffff !important; 
    text-shadow: 1px 1px 3px #000;
}

.navbar .nav-link.active {
    color: #ffffff !important;
}


.navbar.fixed-top {
    background-color: transparent;
    text-shadow: 0px 0px 3px #272727;
    color: white;
    font-size: 0.8rem;
    height: 90px;
    padding-bottom: 30px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.8));
}
.navbar.fixed-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #616161;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 85% 100%, 80% 70%, 0 70%);
    z-index: -1;
}

.navbar .nav-link,
.navbar .dropdown-toggle {
    background-color: #818181;
    color: white;
    border-radius: 5px;
    margin: 6px;
    padding: 10px 20px;
    transition: var(--transition);
    box-shadow: var(--shadow);
    font-size: 0.8rem;
}

/* Estilo para o menu colapsado no modo mobile */
.navbar-collapse {
    background-color: #616161;
    padding: 3px;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

.navbar .nav-link:hover,
.navbar .dropdown-toggle:hover {
    background-color: #494949; 
    box-shadow: var(--shadow-hover); 
    color: white; 
}

.navbar .dropdown-menu {
    background-color: #818181; 
    border-radius: 5px; 
    box-shadow: var(--shadow);
    font-size: 0.8rem;
}

.navbar .dropdown-item {
    color: rgb(0, 0, 0);
    text-shadow: 1px 1px 3px #272727;
    color: white;
}

.navbar .dropdown-item:hover {
    background-color: #494949;
    color: white;
}

.current-time {
    font-size: 1.0em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px #272727;
}

.navbar-brand {
    font-family: 'Jockey One', sans-serif;
    font-size: 1.8rem;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    text-shadow: 1px 1px 3px #272727;
}

.navbar-brand img {
    position: relative;
    width: 40px;
    height: 35px;
    z-index: 2;
    margin-right: 10px;
    box-shadow: var(--shadow-hover);
}

.navbar-version {
    position: absolute;
    bottom: 8px;
    right: 8%;
    font-size: 0.7rem;
    font-weight: bold;
    color: #d3d3d3;
    text-decoration: none;
    opacity: 0.7;
    transition: var(--transition);
}

.navbar-version:hover {
    opacity: 1;
    color: #ffffff;
}

.wave-container {
    position: absolute;
    width: 60px;
    height: 55px;
    top: 50%;
    left: 11.5%;
    transform: translate(-50%, -50%);
    overflow: hidden;
    z-index: 1;
}

.wave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90px;
    height: 90px;
    background: rgba(0, 123, 255, 0.3);
    border-radius: 0;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple 2s infinite;
    pointer-events: none;
}

.wave:nth-child(2) {
    animation-delay: 1s;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/***********************************************
 * 6) CONTAINER PERSONALIZADO
 ***********************************************/

.dashcontainer {
    max-width: 100%;
    margin: 0 auto;
    background-color: #D3D3D3;
    padding: 3px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-shadow: 0px 0px 1px hsl(0, 0%, 0.5%);
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background-color: #D3D3D3;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-shadow: 0px 0px 1px hsl(0, 0%, 0.5%);
}

/***********************************************
 * 7) BOX GENÉRICO
 ***********************************************/

.box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: var(--shadow);
    font-size: 20px;
    font-weight: bold;
}

.box-title {
    margin-bottom: 10px;
    font-size: 18px;
}

/***********************************************
 * 8) TABLE RESPONSIVA
 ***********************************************/

.table-responsive {
    position: relative;
    font-size: 0.650rem;
}

.table-responsive thead th {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 1;
}

h3 {
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px #272727;
}

/***********************************************
 * 9) FORMULÁRIOS DE COMANDOS
 ***********************************************/

.form-control,
.list-group,
.input-group,
.form-label {
    max-width: 100%;
    width: 100%;
}

.list-group-item {
    cursor: pointer;
    transition: var(--transition);
}

.list-group-item:hover {
    background-color: #f0f0f0;
}

.list-group-item.active {
    background-color: #007bff;
    color: white;
}

.control-container {
    display: flex;
    flex-wrap: wrap;
    min-height: 100vh;
}

.selection-section,
.command-section {
    padding: 10px;
}

.selection-section {
    flex: 1 1 300px;
    border-right: 1px solid #ddd;
    overflow-y: auto;
}

.command-section {
    flex: 2 1 600px;
    padding-left: 20px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

.command-box {
    background-color: #D3D3D3;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}

.inline-buttons {
    display: flex;
    justify-content: space-between;
}

.zone-control {
    margin-bottom: 20px;
}

.zone-control label {
    margin-right: 10px;
}

.close-large {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-large:hover,
.close-large:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.command-btn {
    width: 130px;
    height: 55px;
    margin: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.command-btn:hover {
    box-shadow: var(--shadow-hover);
}

.central-list {
    max-height: 200px;
    overflow-y: auto;
}

.command-output {
    width: 100%;
    min-height: 100px;
    resize: vertical;
}

.d-flex.flex-wrap {
    gap: 15px;
}

.btn {
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.btn:hover {
    box-shadow: var(--shadow-hover);
}

#advancedOutput {
    height: 350px;
}

#centralDetails {
    height: 200px;
}

/***********************************************
 * 10) ALERTAS & MONITORING
 ***********************************************/
@keyframes blink {
    0%   { background-color: #dc3545; }
    50%  { background-color: #ff6f6f; }
    100% { background-color: #dc3545; }
}

.alert-box {
    width: 100%;
    height: auto;
    background-color: #dc3545;
    border: 1px solid #a71d2a;
    border-radius: 5px;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    font-size: 14px;
    cursor: pointer;
    animation: blink 1s infinite ease-in-out;
    padding: 10px;
}

.alert-box:hover {
    animation-play-state: paused;
}

.alert-box.clicked {
    background-color: #1372d1;
    animation: none;
    border-color: #fff;
}

.details-box {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    padding: 15px;
    margin-bottom: 10px;
    font-size: 12px;
}

/* Alertas coloridos */
.alert-box.red-alert {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-box.yellow-alert {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

.alert-box.green-alert {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.monitoring-container {
    display: flex;
    height: 80vh;
}

.alerts-section,
.details-section {
    padding: 8px;
}

.alerts-section {
    flex: 1;
    overflow-y: auto;
    max-height: 100%;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: var(--shadow);
    padding: 10px;
    background-color: #9C9C9C;
}

.alerts-section h4 {
    color: black;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.details-section {
    flex: 2;
    overflow-y: auto;
}

.btn-remove {
    background-color: #dc3545;
    color: white;
    margin-top: 10px;
    box-shadow: var(--shadow);
}

.confirmation-box {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border: 1px solid #ddd;
    padding: 20px;
    box-shadow: var(--shadow);
    z-index: 1000;
    text-align: center;
    border-radius: 8px;
}

.confirmation-box.show {
    display: block;
}

.confirmation-box button {
    margin: 5px;
    display: inline-block;
    box-shadow: var(--shadow);
}

/***********************************************
 * 11) TELA ADMINISTRATIVA
 ***********************************************/
.form-group button {
    margin-top: 20px;
    box-shadow: var(--shadow);
}

/***********************************************
 * 12) DASHBOARD (PAINEL PRINCIPAL)
 ***********************************************/


.status-active {
    color: rgb(0, 254, 0);
    text-shadow: 1px 1px 3px #272727;
}

.status-inactive {
    color: red;
    text-shadow: 1px 1px 3px #272727;
}

.dashboard-container {
    display: flex;
    flex-wrap: nowrap;
    height: 80vh;
    align-items: stretch;
}

.dashboard-left-panel {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.dashboard-right-panel {
    flex: 2;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.dashboard-left-grid {
    display: flex;
    flex-wrap: wrap;
    row-gap: 1px;
    column-gap: 1px;
    flex: 1;
    padding: 5px;
}

.dashboard-left-grid > div {
    flex: 1 1 calc(50% - 10px);
    display: flex;
    flex-direction: column;
}

.dashboard-box-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
    padding: 8px;
}

.dashboard-box-title {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 3px;
    text-align: center;
}

.dashboard-box {
    background-color: #f8f9fa;
    padding: 3px;
    border-radius: 3px;
    font-size: 15px;
    font-weight: bold;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 1px 1px 3px #272727;

    clip-path: polygon(15% 0%, 100% 0%, 85% 100%, 0% 100%);
}

.dashboard-central-container {
    background-color: #fff;
    padding: 2px;
    border-radius: 5px;
    box-shadow: var(--shadow);
    margin: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 900px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 0;}

.dashboard-central-container h5 {
    font-size: 0.9rem;
    font-weight: bold;
    padding: 5px;
}

.dashboard-central-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 15px;
    padding: 15px;
    height: auto;
    overflow-y: auto;
}

.dashboard-central-box {
    position: relative;
    width: 100%;
    height: 60px;
    margin-right: 10px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    color: #000;
    padding-left: 8px;
    padding-right: 12px;
    font-size: 9px;
    font-weight: bold;
    border-radius: 5px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    z-index: 1;
    background-color: inherit;
    overflow: hidden;
}

.dashboard-central-box:hover {
    background-color: rgba(200, 255, 0, 0.1);
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.dashboard-central-online {
    background-color: rgb(0, 239, 0);
}

.dashboard-central-offline {
    background-color: rgb(255, 0, 0);
}

.status-bar {
    position: absolute;
    top: 0px;
    right: 1px;
    width: 6px;
    height: 110%;
    border-radius: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.9);
    z-index: -1;
}

.status-armed {
    background-color: hsl(118, 71%, 50%);
}

.status-disarmed {
    background-color: #ff0040;
}

/***********************************************
 * 13) MEDIA QUERIES (RESPONSIVIDADE)
 ***********************************************/

@media (max-width: 1200px) {
    .dashboard-central-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 768px) {
    .form {
        padding: 10px;
    }
    .frame-group > input {
        height: 40px;
        padding: 10px;
    }
    .frame-group > button {
        padding: 20px;
    }
    .title {
        font-size: 24px;
    }
    .subtitle {
        font-size: 16px;
    }
    .monitoring-container {
        flex-direction: column;
    }
    .alerts-section, .details-section {
        width: 100%;
        margin-top: 20px;
    }

    .dashboard-container {
        flex-direction: column;
        height: auto;
    }
    .dashboard-right-panel {
        padding-left: 0;
        margin-top: 0;
    }
    .dashboard-left-grid {
        flex-direction: column;
        row-gap: 10px;
    }
    .dashboard-left-grid > div {
        flex: none;
        width: 100%;
    }
    .dashboard-central-grid {
        grid-template-columns: repeat(4, 1fr);
        height: auto;
    }
    .container {
        width: 95%;
    }
}

@media (max-width: 576px) {
    .dashboard-central-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .container {
        width: 100%;
        padding: 15px;
    }
}

/***********************************************
 * 14) SPINNER COMANDOS
 ***********************************************/

 .spinner-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

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

.alert-box.selected {
    border: 2px solid #0dcaf0; 
    box-shadow: 0 0 10px rgba(13, 202, 240, 0.5);
    background-color: #cff4fc;
    animation: none !important;
    color: #055160;
}

/***********************************************
 * 15) MODAL DE CONFIRMAÇÃO DE TRATATIVA EM MASSA
 ***********************************************/

.confirmation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1040;
    display: flex;
    justify-content: center;
    align-items: center;
}

.confirmation-modal-content {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    width: 90%;
    max-width: 500px;
    text-align: left;
}

.confirmation-modal-header {
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    color: var(--danger);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confirmation-modal-body p {
    margin-bottom: 1rem;
}

.confirmation-modal-footer {
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}