/* --- General Body & Typography --- */
body, html {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #E0E0E0;
    line-height: 1.0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3, h4 {
    color: #FFFFFF;
    margin-top: 0em;
    margin-bottom: 0.3em;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

a {
    color: #4A90E2;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #7AB2F0;
    text-decoration: underline;
}

/* --- Header / Navigation --- */
.header {
    background-color: #1E1E1E;
    padding: 5px 10px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo img {
    height:40px;
    width: auto;
}

.header h1 {
    margin: 0;
    border: none;
    font-size: 1.5em;
}

.header-nav a {
    margin-left: 20px;
}

/* --- Responsive Search Form  --- */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-form input[type="text"] {
    flex-grow: 1;
}

form.search-form button[type="submit"] {
    width: 120px;
    flex-shrink: 0;
}


/* --- Ticket List Table --- */
.ticket-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0px;
}

.ticket-table th, .ticket-table td {
    padding: 6px 7px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.ticket-table thead th {
    background-color: #242424;
    font-weight: 600;
}

.ticket-table tbody tr:hover {
    background-color: #1E1E1E;
}

.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
}

.status-open {
    background-color: #2a9d8f;
    color: #fff;
}

.status-closed {
    background-color: #e76f51;
    color: #fff;
}

.status-waiting {
    background-color: #4b50de;
    color: #fff;
}

/* --- Ticket Detail View --- */
.ticket-header {
    background-color: #1E1E1E;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.ticket-header p {
    margin: 5px 0;
}

.message, .comment {
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.message {
    background-color: #1E1E1E;
    border: 1px solid #333;
}

.comment-internal {
    background-color: #2a2d3b;
    border: 1px solid #4a4e69;
}

.message-header, .comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.comment-internal .comment-header {
    border-bottom: 1px solid #4a4e69;
}

.author {
    font-weight: bold;
    color: #fff;
}

.timestamp {
    font-size: 0.85em;
    color: #888;
}

.attachment-container {
    position: relative;
    display: inline-block;
    margin-top: 10px;
}

.attachment-media {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 500px;
    border-radius: 8px;
}

.download-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.attachment-container:hover .download-button {
    opacity: 1;
}

/* --- Forms (Login & Comments) --- */
.form-container {
    background-color: #1E1E1E;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    margin: 40px auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"], input[type="password"], textarea {
    width: 100%;
    padding: 10px;
    background-color: #121212;
    border: 1px solid #333;
    border-radius: 4px;
    color: #E0E0E0;
    font-size: 1em;
    box-sizing: border-box;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: #4A90E2;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

button[type="submit"]:hover {
    background-color: #5A9FEA;
}

.flash-message {
    padding: 15px;
    background-color: #e76f51;
    color: #fff;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* --- Styles for User Management Page --- */
.user-management-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.user-form {
    flex: 1;
    max-width: 450px;
    margin: 0;
}

.user-list {
    flex: 2;
}

select {
    width: 100%;
    padding: 10px;
    background-color: #121212;
    border: 1px solid #333;
    border-radius: 4px;
    color: #E0E0E0;
    font-size: 1em;
}

.button-danger {
    padding: 8px 12px;
    background-color: #e76f51;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.button-danger:hover {
    background-color: #f4a261;
}