/* ==========================================================================
   osTicket Client UI Theme - Desktop Optimized (Custom Red Theme)
   ========================================================================== */

/* --- Variables --- */
:root {
    --primary-color: #8a0505;
    --primary-hover: #a30606;
    --secondary-color: #91bd09;
    --secondary-hover: #749a02;
    --text-color: #333;
    --text-muted: #666;
    --background-color: #FFFFF0;
    --content-bg: #ffffff;
    --border-color: #ccc;
    --highlight-bg: #f9f9f9;
    --font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --border-radius: 6px;
    --shadow: 0 0 6px rgba(0, 0, 0, 0.15);
}

/* --- Global Reset --- */
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family: var(--font-family);
    font-size: 0.95rem;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
}
a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}
h1, h2, h3, h4 {
    margin-top: 0;
    color: var(--primary-color);
}

/* ==========================================================================
   HEADER LAYOUT
   ========================================================================== */
#header {
    background-color: var(--content-bg);
    border-bottom: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    box-shadow: var(--shadow);
}

/* --- Left: Logo --- */
#logo {
    flex: 0 0 auto;
}
#logo img {
    max-height: 55px;
    width: auto;
}

/* --- Center: Main Navigation --- */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}
.main-nav ul {
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.main-nav li a {
    font-weight: 600;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}
.main-nav li a:hover,
.main-nav li a.active {
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

/* --- Right: User Navigation (Sign In, Profile, etc.) --- */
.user-nav {
    flex: 0 0 auto;
}
.user-nav ul {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.user-nav li a {
    color: var(--primary-color);
    font-weight: 600;
}
.user-nav li a:hover {
    color: var(--primary-hover);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.container {
    background: var(--content-bg);
    width: 90%;
    max-width: 1200px;
    margin: 2rem auto;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    padding: 2rem;
}

/* Ticket listings, content blocks */
#content {
    min-height: 400px;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}
th, td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
thead th {
    background-color: #f2f2f2;
    border-bottom: 2px solid var(--border-color);
}

/* ==========================================================================
   FORMS
   ========================================================================== */
form { margin: 0; }
label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}
input[type=text],
input[type=email],
input[type=password],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: #fff;
    transition: border-color 0.2s ease;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.button,
input[type=submit],
input[type=button] {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.button:hover,
input[type=submit]:hover,
input[type=button]:hover {
    background-color: var(--primary-hover);
}
.button.green { background-color: var(--secondary-color); }
.button.green:hover { background-color: var(--secondary-hover); }

/* ==========================================================================
   TICKET THREADS
   ========================================================================== */
.thread-entry {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow: hidden;
}
.thread-entry .header {
    background: #f4f4f4;
    padding: 1rem;
    font-weight: 600;
}
.thread-entry.message .header {
    background: #cde1ff;
}
.thread-entry.response .header {
    background: #eaeaea;
}
.thread-entry .thread-body {
    padding: 1rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
#footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-top: 3rem;
}

/* ==========================================================================
   ALERTS
   ========================================================================== */
#msg_notice, #msg_warning, #msg_error {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
}
#msg_notice {
    color: #2f6627;
    background-color: #e7f7e7;
    border-color: #7cc27c;
}
#msg_warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}
#msg_error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 991px) {
    #header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .main-nav ul,
    .user-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
}
/* ==== Modern Header Layout for osTicket Client Portal ==== */

/* Overall container alignment */
#container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Header alignment (Logo left, Sign-in right) */
#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--content-bg, #fff);
    border-bottom: 3px solid var(--primary-color, #2a72d4);
    padding: 0.75rem 2rem;
    flex-wrap: wrap;
    position: relative;
}

/* Left logo */
#header #logo {
    display: flex;
    align-items: center;
    order: 1;
}
#header #logo img {
    max-height: 55px;
    width: auto;
}

/* Right-side sign-in / user menu */
#header .pull-right.flush-right {
    order: 2;
    text-align: right;
}
#header .pull-right.flush-right p {
    margin: 0;
    font-size: 0.95rem;
}
#header .pull-right.flush-right a {
    color: var(--primary-color, #2a72d4);
    font-weight: 600;
    text-decoration: none;
}
#header .pull-right.flush-right a:hover {
    text-decoration: underline;
}

/* ===== Navigation Bar ===== */
#nav {
    display: flex !important;
    justify-content: center;
    align-items: center;
    list-style: none;
    background-color: var(--header-bg, #f6f8fa);
    border-bottom: 1px solid #ddd;
    margin: 0;
    padding: 0.75rem 0;
    gap: 2rem;
}
#nav li {
    margin: 0;
    padding: 0;
}
#nav li a {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color, #333);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}
#nav li a:hover,
#nav li a.active {
    background-color: var(--primary-color, #2a72d4);
    color: #fff;
}

/* ===== Page content area ===== */
#content {
    padding: 2rem 1rem;
    background-color: #fff;
}

/* ==== Responsive for smaller viewports ==== */
@media (max-width: 900px) {
    #header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    #header .pull-right.flush-right {
        order: 3;
        text-align: center;
        margin-top: 0.5rem;
    }
    #nav {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 0.5rem 0;
    }
}

/* --- Optional: Make table responsive --- */

@media (max-width: 1024px) {
    #ticketTable, #ticketTable thead, #ticketTable tbody, #ticketTable th, #ticketTable td, #ticketTable tr {
        display: block;
        width: 100%;
    }

    #ticketTable thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    #ticketTable tr {
        margin-bottom: 1rem;
        border-bottom: 1px solid #ddd;
    }

    #ticketTable td {
        padding-left: 50%;
        position: relative;
    }

    #ticketTable td:before {
        position: absolute;
        top: 8px;
        left: 10px;
        width: 45%;
        white-space: nowrap;
        font-weight: bold;
        content: attr(data-label);
    }
}

/* ============================================================
   osTicket Ticket View – Clean Two-Column Alignment Fix
   Works with provided HTML structure exactly
   ============================================================ */

/* ---- Ticket Header ---- */
#ticketInfo h1 {
    font-size: 28px;
    font-weight: 800;
    color: #8b0000;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

#ticketInfo h1 small {
    font-size: 20px;
    color: #555;
    margin-left: 6px;
}

#ticketInfo .pull-right a.action-button {
    font-weight: bold;
    font-size: 15px;
    margin-left: 25px;
    color: #8b0000 !important;
}

#ticketInfo .pull-right a.action-button i {
    margin-right: 5px;
}

/* ---- Two Main Columns ---- */
#ticketInfo > tbody > tr:nth-child(2) td {
    vertical-align: top;
    padding: 0 10px;
}

/* ---- Info Tables ---- */
.infoTable,
.custom-data {
    width: 100%;
    border-spacing: 0;
    margin-top: 5px;
    background: #fff;
}

.infoTable .headline,
.custom-data .headline {
    background: #fafafa;
    font-size: 16px;
    font-weight: 700;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

/* ---- Labels (left side of each row) ---- */
.infoTable th,
.custom-data th {
    width: 160px;
    text-align: left;
    padding: 8px 12px;
    background: #fff;
    color: #333;
    font-weight: bold;
    border-bottom: 1px solid #f1f1f1;
}

/* ---- Values (right side) ---- */
.infoTable td,
.custom-data td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f1f1;
    color: #222;
}

/* Improve row spacing & readability */
.infoTable tr,
.custom-data tr {
    line-height: 1.5em;
}

/* ---- Ticket Details Section ---- */
.custom-data {
    margin-top: 20px !important;
}

/* ---- Make layout responsive ---- */
@media (max-width: 900px) {
    #ticketInfo tr td {
        width: 100% !important;
        display: block;
    }
}

.button.blue:hover {
    background-color: #b3d7ff !important;
    color: #000 !important;
}

.button.green:hover {
    background-color: #c8f2b0 !important;
    color: #000 !important;
}