/* --- Base Styles --- */
:root {
    --primary: #2c3e50;
    --accent: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
}

body { font-family: sans-serif; background: #f4f7f6; margin: 0; padding-bottom: 60px; }




.container { padding: 15px; max-width: 1200px; margin: auto; }
.card { background: white; padding: 15px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); margin-bottom: 15px; }

/* --- Tablet & Desktop Navigation --- */
header { background: var(--primary); color: white; padding: 1rem; display: flex; justify-content: space-between; align-items: center; }
nav a { color: white; text-decoration: none; margin-left: 15px; padding: 5px 10px; }

/* --- The Mobile Magic --- */
@media (max-width: 768px) {
    /* Stack the Header */
    header { flex-direction: column; text-align: center; }
    nav { margin-top: 15px; display: flex; flex-wrap: wrap; justify-content: center; }
    nav a { margin: 5px; background: rgba(255,255,255,0.1); border-radius: 4px; font-size: 0.9rem; }

    /* Turn Tables into Cards (The "Initiative" List) */
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { position: absolute; top: -9999px; left: -9999px; } /* Hide headers */
    
    tr { border: 1px solid #ddd; margin-bottom: 10px; background: white; border-radius: 8px; padding: 10px; }
    td { border: none; position: relative; padding-left: 50% !important; text-align: right; }
    
    /* Label the data for mobile */
    td:before {
        position: absolute; left: 10px; width: 45%; padding-right: 10px; 
        white-space: nowrap; text-align: left; font-weight: bold;
        content: attr(data-label); /* We'll add this to our PHP next */
    }

    /* Make buttons full width for thumbs */
    .btn { display: block; width: 100%; text-align: center; margin-bottom: 5px; box-sizing: border-box; }
}

/* Form Responsiveness */
input[type="text"], input[type="email"], input[type="password"], select, textarea {
    width: 100%;
    padding: 12px; /* Larger hit area for fingers */
    font-size: 16px; /* Prevents iOS auto-zoom on focus */
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

footer { flex-direction: column; text-align: center; }

/* Dashboard KPI Badges */
.badge {
    display: inline-block;
    font-weight: bold;
    text-transform: uppercase;
}

/* Responsive Grid for Dashboard */
@media (max-width: 600px) {
    .container { padding: 10px; }
    h2 { font-size: 1.4rem; }
}

/* Card Hover effect for the Dashboard */
.card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.opposing_text {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-row {
  display: flex;             /* Activates Flexbox */
  justify-content: space-between; /* Pushes items to the far edges */
  align-items: center;       /* Ensures both texts are vertically centered */
  width: 100%;               /* Ensures it spans the full width of the page */
  border-bottom: 1px solid #ccc; /* Optional: adds a divider line */
  padding: 10px 0;
}
  .nav-bar {
    display: flex;
    justify-content: space-between;
    background-color: #2c3e50;
    color: white;
    padding: 15px 25px;
    font-family: sans-serif;
  }

  .left-side {
    font-weight: bold;
  }

  .right-side {
    font-style: italic;
    text-align: right; /* Keeps text aligned right if it wraps */
  }
  
  /* Add this to make the directory rows feel more like a professional app */
.asset-row:hover {
    background-color: #f1f3f5 !important;
}

.asset-row code {
    user-select: all; /* Allows mechanics to double-click the code to copy it instantly */
    cursor: pointer;
}



/* Ensure the container is a vertical stack */
#asset_results_list {
    display: none; /* Hidden by default */
    flex-direction: column; 
    background-color: #fff;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
    position: absolute;
    width: 100%;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Each item is a block-level row */
.asset-result-item {
    display: block !important;
    width: 100%;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.asset-result-item:last-child {
    border-bottom: none;
}

.asset-result-item:hover {
    background-color: #f1f5f9;
    color: #007bff;
    text-decoration: none;
}

.asset-result-item i {
    color: #6c757d;
    margin-right: 10px;
}


.lib-results { 
    position: absolute; 
    z-index: 1050; /* Higher than modal z-index */
    width: 95%; 
    max-height: 200px; 
    overflow-y: auto; 
    background: #fff; 
    border: 1px solid #ddd;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}




.edit-pfmea[contenteditable="true"] {
    display: inline-block;
    min-width: 25px;
    padding: 0 4px;
    cursor: text;
    transition: all 0.2s;
    border-radius: 3px;
}

.edit-pfmea[contenteditable="true"]:hover {
    background-color: #fff3cd; /* Light yellow highlight */
    border: 1px solid #ffeeba !important;
}

.edit-pfmea[contenteditable="true"]:focus {
    outline: 2px solid #007bff;
    background-color: #fff;
    box-shadow: 0 0 5px rgba(0,123,255,0.25);
}


.edit-severity_score:focus {
    outline: 2px solid #17a2b8; /* Cyan outline when active */
    background-color: #f8f9fa;
    min-width: 30px;
    display: inline-block;
}


.tooltip-inner {
    max-width: 250px;
    text-align: left;
}

/* This ensures the breadcrumb separator (the slash /) is visible and not white */
.breadcrumb-item + .breadcrumb-item::before {
    color: #6c757d; 
}


.transition-icon {
    transition: transform 0.3s ease;
}
.fa-rotate-180 {
    transform: rotate(180deg);
}
#logHeader:hover {
    background-color: #f8f9fa !important;
}

@keyframes pulseDangerGlow {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 0 10px 3px rgba(220, 53, 69, 0.6); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}
.pulse-danger-badge {
    animation: pulseDangerGlow 2s infinite ease-in-out;
}
.text-truncate-custom {
    display: block;
    max-width: 290px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Custom High-Contrast for Defect Catalogue on Mobile Screens */
.border-success-glow {
    border: 5px solid #198754 !important; /* Thick safety-green border */
    box-shadow: 0 0 15px rgba(25, 135, 84, 0.45), 0 10px 25px rgba(0,0,0,0.5) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.border-danger-glow {
    border: 5px solid #dc3545 !important; /* Thick reject-red border */
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.45), 0 10px 25px rgba(0,0,0,0.5) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}