﻿body {
    display: inline-block;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, rgba(#242e4d, .9), rgba(#897e79, .9));
    font-family: DroidSans, Droid Sans, Verdana;
}

.device-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px;
    background-color:white;
}

.device-header,
.device-row {
    display: grid;
    grid-template-columns: 0.5fr 0.8fr 1fr 1fr 2fr 1.5fr 1fr 100px;
    padding: 12px;
    align-items: center;
}

   
.icon-cell .disabled {
    opacity: 0.35;
    cursor: default;
}

/* Header styling */
.device-header {
    font-weight: bold;
    border-bottom: 2px solid #ddd;
    color: #333;
}

.device-row {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

    .device-row:hover {
        background-color: #f9f9f9;
    }

/* Status Pill Styling */
.status-pill {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    text-align: center;
    font-weight: bold;
}

.online {
    background-color: #e6fffa;
    color: #2c7a7b;
}

.offline {
    background-color: #fff5f5;
    color: #c53030;
}

.search-container {
    margin: 20px;
}

.controls-container {
    display: flex;
    gap: 15px;
    margin: 20px;
    align-items: center;
}

#grid-search {
    flex: 1; /* Search takes up available space */
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: DroidSans, Droid Sans, Verdana;
}

#type-filter {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    color: gray;
    font-family: DroidSans, Droid Sans, Verdana;
}

#grid-search:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.2);
}

.clickable {
    cursor: pointer;
    transition: background 0.2s;
}

    .clickable:hover {
        background-color: #edf2f7;
        border-left: 4px solid #4A90E2;
    }

.details-panel {
    margin: 20px;
    padding: 20px;
    background: #fff;
    border: 2px solid #4A90E2;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.icon-cell {
    display: flex;
    justify-content: center;
    align-items: center;
}

.clickable {
    cursor: pointer;
    padding: 8px;
    transition: transform 0.1s, color 0.2s;
}

    .clickable:hover {
        transform: scale(1.2);
    }

.mt-10 {
    margin: 10px auto;
}

.mt-15 {
    margin-top: 15px;
}

.mb-10 {
    margin-bottom: 10px;
}

#rule-type-label {
    font-weight: bold;
    font-size: 1em !important;
    color: #444;
    font-family: inherit;    
}

#input-slots{
    width:70%;
}

#input-slots label {
    font-family: inherit;
    display: block;
    font-weight: bold;
    font-size: 1em !important;
    margin-top: 10px;
    margin-bottom: 4px;
    color: #444;
}

#rule-type-select {
    font-family: inherit;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 2.5em;
    font-size: 1em !important;
}

textarea {
    border: 1px solid #ccc;
    border-radius:5px;
    min-height:100px;
    margin:5px;
}

#input-slots select {
    font-family: inherit;
    width: 10%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Important so padding doesn't break width */
    font-size: 1em !important;
    height: 1.2em;
}

#input-slots input[type=number]{
    font-family: inherit;
    width: 50%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Important so padding doesn't break width */
    font-size: 1em !important;
    height: 1.2em;
}

#input-slots input[type=time] {
    font-family: inherit;
    width: 60%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Important so padding doesn't break width */
    font-size: 1em !important;
    height: 1.2em;
}

#input-slots input[type=date] {
    font-family: inherit;
    width: 40%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Important so padding doesn't break width */
    font-size: 1em !important;
    height: 1.2em;
}

/* Container for side-by-side inputs */
.input-row {
    display: flex;
    gap: 12px; /* Space between the two columns */
    align-items: flex-end;
}

/* Each column takes up equal width */
.input-col {
    flex: 1;
}

    /* Ensure labels inside the columns don't wrap weirdly */
    .input-col label {
        display: block;
        font-size: 0.8em;
        margin-bottom: 4px;
    }

.fa-bell {
    color: #f39c12;
}
/* Warning Orange */
.fa-camera {
    color: #3498db;
}
/* Action Blue */

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border: 2px solid cadetblue;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    font-family:inherit;
}

.btn-inspect {
    background: #4A90E2;
    color: white;
}

.btn-photo {
    background: #38a169;
    color: white;
    display: inline-block;
}

.btn.hidden{
    display:none;
}

.photo-section{
    margin:20px 0;
}

#preview-container {
    width: 400px;
    margin: 0 auto;
}

#photo-preview {
    max-width: 100%; /* Never wider than the parent container */
    height: auto; /* Keep the aspect ratio correct */
    display: block; /* Removes weird bottom spacing */
    margin: 10px auto; /* Centers it and adds some breathing room */
    border: 2px solid #ddd;
    border-radius: 8px;
}

#meter-reading-value {
    width: 70%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius:8px;
}

#inspection-note-input {
    width: 70%;
}

.sub-form {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

    .sub-form h4, .sub-form h5 {
        margin-top: 0;
        color: #007bff;
    }

.flex-row {
    display: flex;
    gap: 10px;   
    justify-content:center;
}

    .flex-row div {
        flex-grow: 0;
        flex-shrink: 0;
        flex-basis: 50%;
    }

.mt-15 {
    margin-top: 15px;
}

.btn-save {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    margin-left: 5px;
}

.close-btn {
    float: right;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
}

.rule-card {
    background: #f9f9f9;
    border-left: 4px solid #82b74b; /* Green accent */
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rule-info strong {
    display: block;
    font-size: 0.9em;
    color: #333;
    text-transform: capitalize;
}

.rule-info p {
    margin: 0;
    font-size: 0.85em;
    color: #666;
}

.rule-card.is-disabled {
    background-color: #f9f9f9;
    border-left-color: #ccc;
    opacity: 0.7;
}

.audit-footer {
    font-size: 0.75rem;
    color: #777;
    margin-top: 10px;
    border-top: 1px dashed #ccc;
    padding-top: 5px;
}

.audit-row {
    display: flex;
    gap: 4px;
    font-size: 0.75rem;
    color: #777;
    margin-top: 8px;
    border-top: 1px solid #f0f0f0;
    padding-top: 6px;
    white-space: nowrap; /* Keep it on one line */
    overflow: hidden; /* Hide overflow */
}

.audit-name {
    font-weight: 600;
    color: #555;
    /* The Ellipsis Logic */
    flex-shrink: 1; /* Allow this part to shrink first */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-label, .audit-date {
    flex-shrink: 0; /* Don't let the 'Set by' or 'Date' disappear */
}

.btn-delete {
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 5px 10px;
    cursor: pointer;
}

/* Add this to your panel CSS */
.status-msg {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    display: none; /* Hidden by default */
}

    .status-msg.danger {
        background-color: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
        display: block;
    }

    .status-msg.error {
        background-color: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }

    .status-msg.success {
        background-color: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
        display: block;
    }

    .status-msg.working {
        background-color: #d1ecf1;
        color: #0c5460;
        border: 1px solid #bee5eb;
    }

    .status-msg.hidden {
        display: none;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

    .empty-state i {
        font-size: 3rem;
        margin-bottom: 15px;
        color: #ddd;
    }

    .empty-state p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

.btn-minimal {
    background: none;
    border: 1px solid #3498db;
    color: #3498db;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

    .btn-minimal:hover {
        background: #3498db;
        color: white;
    }

@media screen and (max-width: 600px) {
    #input-slots input,
    #input-slots select {
        font-size: 0.9em !important;
    }

    #meter-reading-value {
        width: 70%;
        padding: 10px;
        margin:5px;
    }

    #inspection-note-input {
        width: 90%;
        font-size: 0.9em !important;
    }

    #input-slots label {
        font-size: 0.9em !important;
    }

    .search-container {
        margin: 5px !important;
    }

    #grid-search {
        max-width: 350px;
        padding: 5px;
        margin: inherit;
        font-size:0.8em;
    }

    #type-filter {
        font-size:0.7em !important;
        padding: 5px;
        border-radius: 8px;
    }

    .device-container {
        overflow: hidden;
        margin: 5px;
    }

    /* Alerts enabled */
    .device-header, .device-row {
        display: grid;
        /* Defines 8 columns with specific widths */
        grid-template-columns: 0.5fr 0.8fr 1fr 1fr 0.5fr;
        padding: 5px;
        align-items: center;
    }

    .device-header {
        font-size: 0.7em;
        font-weight: 600;
    }

    .device-row {
        font-size: 0.7em;
        font-weight: normal;
    }

    .details-panel {
        margin: 5px;
        padding: 5px;
    }

    .details-header > h3 {
        font-size: 0.7em;
        background-color: #f4f4f7;
        padding: 5px;
        margin: 5px;
    }

    .details-content {
        font-size: 0.6em;
    }

    .info-summary > p {
        margin: 0 0 5px 0;
    }

    .btn {
        padding: 5px 10px;
        font-size: 0.9em;
    }

    .rule-card {
        padding: 5px;
        display: block;
    }

    .rule-header {
        padding: 5px;
    }

    .rule-card > p{
      margin:5px;
      font-size:0.9em;
    }

    .sub-form {
        padding: 5px;
        margin-top: 5px;
    }

    #input-slots {
        width: 90%;
    }

        #input-slots input[type=date] {
            padding: 10px;
        }

        #input-slots input[type=number]{
            margin-bottom:0;
        }

        #input-slots input[type=time] {
           width:65%;
        }

        .flex-row {
            align-items: anchor-center;
        }

    .audit-row{
        font-size:0.9em;
    }

    .status-msg {
        font-size: 0.9em;
    }
}

