/* Variables use*/
:root {
    --background-color: #0d1016;
    --text-color: #dadce0;
    --button-color: #00C9A7;
    --border-color: #dadce0;
    --table-background-color: #0E1116;
    --table-border: #454746;
    --offline-status: #CA3142;
    --sidebar-width: 220px;
}
body {
    min-height: 100vh;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: "SFMono-Regular", "SF Mono", monospace;
}
header{
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    background-color: var(--button-color);
}
header h1{
    font-size: 2.5rem;
    margin: 20px 0px 10px 35px;
    font-family: "Google Sans Flex", sans-serif;
    font-weight: 700;
    color: var(--border-color);
}
.message{
    width: 700px;
    margin: 10px auto;
    padding: 8px;
    text-align: center;
    border-radius: 5px;

    opacity: 1;
    max-height: 100px;
    overflow: hidden;

    transition:
        opacity 0.5s ease,
        max-height 0.5s ease,
        padding 0.5s ease,
        margin 0.5s ease;
}
.message.hide {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
}
.message.success {
    background-color: green;
}
.message.error {
    background-color: #CA3142;;
}
.message.warning {
    background-color: #ffc107;
}
main{
    display: flex;
    flex-direction: column;
}
.sidebar{
    display: flex;
    flex-direction: row;
    justify-content: right;
    gap: 15px;
    margin-right: 25px;
    margin-top: 25px;
    opacity: 0.9;
}
.sidebar p{
    font-size: 1.1rem;
}
.sidebar a, td a{
    text-decoration: none;
    color: white;
}
.sidebar a.active {
    color: var(--background-color);
    font-weight: bolder;
    text-decoration: underline;
    text-decoration-color: var(--background-color);
    text-decoration-thickness: 5px;
    text-underline-offset: 8px;
}
.sidebar a:hover {
    color: var(--background-color);
    opacity: 0.8;
}
td a:hover {
    color: var(--button-color);
    cursor: pointer;
}
.sidebar .active{
    color: var(--button-color);
}
.devices{
    flex: 1;
    padding: 15px;
}
.action{
    display: flex;
    justify-content: right;
    gap: 15px;
    margin-top: 10px;
    margin-right: 10px;
}
.action select, button{
    width: 160px;
    height: 45px;
    border-radius: 5px;
    cursor: pointer;
}
button{
    background-color: var(--button-color);
}
.button-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 160px;
    height: 40px;
    border-radius: 5px;
    cursor: pointer;
    background-color: var(--button-color);
    text-decoration: none; /* Removes the underline */
    font-weight: bold;
    color: white;
}
.button-link:hover {
    opacity: 0.8;
    cursor: pointer;
}
.devices h2{
    margin-left: 15px;
}
table {
    border-collapse: collapse;
    width: 90%;
    border-left: 1px solid var(--table-border);
    border-right: 1px solid var(--table-border);
    margin: 10px auto;
    background-color: var(--table-background-color);
}
caption {
    text-align: left;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}
thead tr {
    background-color: #333333;
    color: #ffffff;
}
th {
    border-top: 1px solid var(--table-border);
}
th, td {
    padding: 12px;
    border-bottom: 1px solid var(--table-border);
    text-align: left;
}
tbody tr:nth-child(even) {
    background-color: #161515;
}
tbody tr:hover {
    background-color: #333333;
    opacity: 0.6;
}
.offline{
    color: var(--offline-status);
}
.online{
    color: var(--button-color);
}
.no_data {
    min-height: 300px;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 32px;
    font-weight: bold;
}



/* ==========================================================================
    Tablet Styles (Triggers at 1024px down to 768px)
   ========================================================================== */
@media (max-width: 1024px) {
    header {
        display: flex;
        flex-direction: column;
    }
    header h1 {
        font-size: 1.8rem;
        margin: 10px 0px 5px 10px;
    }
    .message, .errormessage {
        width: 90%;
        margin: 5px auto;
        text-align: center;
    }
    .sidebar {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
        margin-right: 5px;
        margin-top: 5px;
    }
    .action {
        display: flex;
        justify-content: center;
        gap: 5px;
        margin-top: 0px;
        margin-right: 0px;
    }
    .action select, button {
        width: 120px;
        height: 40px;
    }
    table {
        width: 100%;
    }
    caption {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }

    /* FIX: Hide the tablet columns here */
    th.tablet, td.tablet {
        display: none !important;
    }
}

/* ==========================================================================
   Phone Styles (Triggers at 767px and below)
   ========================================================================== */
@media (max-width: 767px) {
    header h1 {
        font-size: 1.8rem;
        margin: 5px 0px 5px 10px;
    }
    header nav{
        margin-bottom: 10px;
    }
    .action select, button {
        width: 100px;
        height: 40px;
    }
    caption {
        font-size: 1.1rem;
    }

    /* FIX: A phone is ALSO smaller than a tablet! 
        We must hide BOTH tablet and mobile columns here. */
    th.tablet, td.tablet,
    th.mobile, td.mobile {
        display: none !important;
    }
}


/* ==========================================================================
*****************************************************************************
                Style for add_device.html
*****************************************************************************
   ========================================================================== */
.device-details{
    width: 90%;
    margin: 30px auto;
    padding: 25px;
    border: 1px solid var(--table-border);
    border-radius: 10px;
}
.device-details form{
    display: flex;
    flex-direction: column;
}
form .form-details{
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    /* justify-content: space-between; */
    gap: 40px;
    margin-bottom: 35px;
}
.form-details .input-box{
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 31%;
}
.input-box input, .input-box select{
    box-sizing: border-box;
    width: 100%;
    height: 45px;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding-left: 15px;
    font-size: 16px;
    border-bottom-width: 3px;
    transition: all 0.3s ease;
}
form .form-actions{
    display: flex;
    justify-content: right;
    gap: 30px;
    
}
.form-actions button, form-actions .button-link{
    font-size: 1.1rem;
    font-weight: bold;
}

/* ==========================================================================
    Add device page - Tablet Styles (1024px down to 768px)
   ========================================================================== */
@media (max-width: 1024px) {
    .device-details{
        width: 95%;
        margin: 20px auto;
        padding: 20px;
    }
    form .form-details{
        gap: 25px;
        margin-bottom: 25px;
    }
    .form-details .input-box{
        flex: 0 0 48%;
    }
    .input-box input, .input-box select{
        height: 40px;
        padding-left: 13px;
        font-size: 15px;
        border-bottom-width: 2px;
    }
    form .form-actions{
        justify-content: center;
    }
}

/* ==========================================================================
    Add_Device Phone Styles (767px and below)
   ========================================================================== */
@media (max-width: 767px) {
        form .form-details{
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 25px;
        margin-bottom: 35px;
    }
    .form-details .input-box{
        width: 85%;
        margin: 0 auto;
    }
    form .form-actions{
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 30px;
    }
    .form-actions .button-link{
        width: 85%;
        margin: 0 auto;
    }
}




