/* Reset and Global Styling */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Prevent unwanted horizontal scroll */
}

/* Ensure the wrapper takes the full height of the viewport */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* HEADER: Fixed at the top */
header {
    margin: 0;
    padding: 10px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

span[title] {
    cursor: help;
    color: #555;
    margin-left: 4px;
}

/* NAVBAR: Properly aligned under header */
.navbar {
    width: 100%;
    background-color: #444;
    position: fixed;
    top: 0px;
    left: 0;
    z-index: 1050; 
    padding: 10px 0;
    display: flex;
    justify-content: center;
}

.navbar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.navbar ul li {
    margin: 0 15px;
}

.navbar ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

/* 4️⃣ Dropdown Menus */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #3a7e79;
    min-width: 160px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1100; /* Higher than header */
    top: 100%;
    left: 0;
    border-radius: 5px;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #385860;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* MAIN CONTENT: Prevents overlap with fixed header */
.content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* 👈 Moves content closer to the top */
    text-align: center;
    padding: 20px;
    padding-bottom: 80px;
    margin: 60px auto 20px; /* 👈 Reduced from 120px to 60px */
    width: 90%;
    max-width: 100%;
    border-radius: 10px;
}

/* Ensure center box is properly centered */
.container {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.container-wide {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    max-width: none;
    width: 100%;
    margin: 0 auto;
}

/* Ensure images are centered */
.content img {
    display: block;
    margin: 20px auto;
    max-width: 100%;
    height: auto;
}

/* FOOTER: Stays at the bottom */
footer {
    width: 100%;
    text-align: center;
    background: #333;
    color: white;
    padding: 20px 0;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
}

/* Primary Blue Button */
.btn {
    background-color: #3a7e79;
    display: inline-block;
    color: white;
    border: none;
    padding: 4px 8px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 10px; /* Slightly rounded corners */
    cursor: pointer;
    transition: background 0.3s ease-in-out;
    box-shadow: 1px 1px #004ea2;
}

/* Hover Effect */
.btn:hover {
    background-color: #385860; /* Darker shade on hover */
}

/* Button Click Effect */
.btn:active {
    box-shadow: 1px 1px #00408b;
    transform: translate(2px, 2px);
}

/* Special Delete Button */
.btn-delete {
    background-color: red;
    color: white;
    box-shadow: 3px 3px #a50000;
}

.btn-delete:hover {
    background-color: #385860;
}

/* Ensure all buttons inside table use .btn class */
table button {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    font-weight: bold;
    background-color: #3a7e79;
    color: white;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

/* Button Hover in Table */
table button:hover {
    background-color: #385860;
}

/* Form Container */
.form-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Form Group (Each Row) */
.form-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
}

/* Labels */
.form-group label {
    width: 40%; /* Right-align text */
    text-align: right;
    font-size: 14px;
    font-weight: bold;
    padding-right: 10px; /* Space between label and input */
}

/* Inputs */
.form-group input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.form-group select {
    width: 55%; /* Match the width of input fields */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

/* Button Container */
.button-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 40px;
}

/* Primary Button */
.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px; /* Pill shape */
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background-color: #0056b3;
}

/* Green Button (Make Active) */
.btn-success {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 4px 8px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 10px; /* Slightly rounded corners */
    cursor: pointer;
    transition: background 0.3s ease-in-out;
    box-shadow: 1px 1px #004ea2;
}

.btn-success:hover {
    background-color: #218838;
}

/* Red Button (Make Inactive) */
.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 10px; /* Slightly rounded corners */
    cursor: pointer;
    transition: background 0.3s ease-in-out;
    box-shadow: 1px 1px #004ea2;
}

.btn-danger:hover {
    background-color: #c82333;
}

.message-box {
    max-width: 500px;
    margin: 20px auto;
    padding: 15px;
    text-align: center;
    border-radius: 5px;
    font-size: 16px;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ✅ Make the Table Scrollable for Wide Data */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    border: 1px solid #ddd;
    padding: 10px;
    background: white;
}

/* ✅ General Table Styling */
table {
    border-collapse: collapse;
    background: white;
}

th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    white-space: nowrap; /* Prevents text wrapping in wide tables */
}

th {
    background-color: #f4f4f4;
    cursor: pointer;
    font-weight: bold;
}

/* ✅ Color Coding for Adjustments */
.negative {
    color: red;
    font-weight: bold;
}

.positive {
    color: green;
    font-weight: bold;
}

/* ✅ Style for the Back Button */
.back-button {
    display: inline-block;
    padding: 10px 15px;
    font-size: 16px;
    color: white;
    background: #007bff;
    text-decoration: none;
    border-radius: 5px;
    transition: 0.3s;
}

.back-button:hover {
    background: #0056b3;
}

/* ✅ Center the controls but add space between them */
.ticket-controls {
    display: flex;
    justify-content: center; /* Center everything */
    align-items: center;
    gap: 40px; /* Adds space between "Add New Ticket" and "Show:" */
    margin-bottom: 10px;
}

/* ✅ Keep "Show:" label and dropdown in one row */
.filter-container {
    display: flex;
    align-items: center;
    gap: 5px; /* Add spacing between label and dropdown */
}

/* ✅ Fixed Size for Ticket Input Box */
.fixed-textarea {
    width: 100%;  /* Stretches across the form */
    max-width: 500px;  /* Prevents it from getting too wide */
    height: 100px;  /* A comfortable height */
    resize: none;  /* Prevents manual resizing */
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.content a:last-of-type {
    display: block;
    margin-bottom: 0px; /* ✅ Adds space below the "Back to Departments" link */
}

table a.btn {
    text-decoration: none; /* Ensure buttons inside tables are NOT underlined */
    display: flex; 
    justify-content: center; /* Centers horizontally */
    align-items: center; /* Centers vertically */
    text-align: center;
}

.yellow-highlight {
    background-color: #FFE066; /* Warm yellow, colorblind-friendly */
}

.blue-highlight {
    background-color: #66B3FF; /* Soft blue, colorblind-friendly */
}

a.btn, .btn a {
    text-decoration: none !important; /* ✅ Forces removal of underline */
}

/* Nested dropdown base */
.nested-dropdown {
    position: relative;
}

/* Proper nested menu styling */
.nested-dropdown-content {
    display: none;
    position: absolute;
    left: 100%; /* right of parent */
    top: 0;
    min-width: 180px;
    background-color: #3a7e79;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1200;
    border-radius: 5px;
}

.nested-dropdown:hover .nested-dropdown-content {
    display: block;
}

