/* Issue Tracker - Main Stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

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

/* Header */
header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    padding: 8px 0;
    margin-bottom: 15px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 18px;
    color: #333;
    font-weight: 600;
    margin: 0;
}

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

.user-info {
    color: #666;
    font-size: 13px;
}

/* Admin Menu */
.admin-menu {
    position: relative;
    display: inline-block;
}

.admin-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 160px;
    z-index: 1000;
    margin-top: 5px;
}

.admin-dropdown a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.admin-dropdown a:last-child {
    border-bottom: none;
}

.admin-dropdown a:hover {
    background-color: #f8f9fa;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 30px;
    text-align: center;
    color: #333;
    font-size: 28px;
}

/* Forms */
.form-group {
    margin-bottom: 12px;
}

label {
    display: block;
    margin-bottom: 4px;
    color: #555;
    font-weight: 500;
    font-size: 13px;
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background-color: #fff;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #4a90e2;
    background-color: #fff;
}

textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

/* Buttons */
button,
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #4a90e2;
    color: #fff;
}

.btn-primary:hover {
    background-color: #357abd;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-success {
    background-color: #28a745;
    color: #fff;
}

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

.btn-link {
    background-color: transparent;
    color: #4a90e2;
    padding: 5px 10px;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-full {
    width: 100%;
}

/* Filter Bar */
.filter-bar {
    background-color: #fff;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

/* Table */
.table-container {
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

tbody tr {
    cursor: pointer;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

.table-link {
    color: #4a90e2;
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.status-open,
.status-active {
    background-color: #fff3cd;
    color: #856404;
}

.status-resolved {
    background-color: #d4edda;
    color: #155724;
}

.status-archived {
    background-color: #e2e3e5;
    color: #6c757d;
}

/* Issue Detail */
.issue-header {
    background-color: #fff;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
}

.issue-header h2 {
    margin-bottom: 10px;
    color: #333;
    font-size: 18px;
}

.issue-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 11px;
    color: #777;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 3px;
}

.meta-value {
    font-size: 13px;
    color: #333;
}

/* Notes Section */
.notes-section {
    background-color: #fff;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
}

.notes-section h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

.note-item {
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 3px solid #4a90e2;
    margin-bottom: 10px;
    border-radius: 4px;
}

.note-item:last-child {
    margin-bottom: 0;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 11px;
    color: #666;
}

.note-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 11px;
}

.note-meta span {
    color: #555;
}

.note-meta strong {
    color: #333;
}

.note-text {
    color: #333;
    white-space: pre-line;
    line-height: 1.4;
    font-size: 13px;
}

/* Add Note Form */
.add-note-section {
    background-color: #fff;
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.add-note-section h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

/* Duplicate Check Results */
.duplicate-results {
    background-color: #fff9e6;
    border: 1px solid #ffd966;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.duplicate-results h3 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 16px;
}

.duplicate-list {
    list-style: none;
    margin-bottom: 15px;
}

.duplicate-item {
    padding: 12px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
}

.duplicate-item:last-child {
    margin-bottom: 0;
}

.duplicate-item a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: 500;
}

.duplicate-item a:hover {
    text-decoration: underline;
}

.duplicate-item .issue-info {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.autocomplete-item:hover {
    background-color: #f8f9fa;
}

.autocomplete-item .usage-count {
    font-size: 11px;
    color: #999;
}

/* Messages */
.alert {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

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

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

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

.empty-state-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.action-bar h2 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

/* Hidden by default */
.hidden {
    display: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 20px 25px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

/* Sortable Table Headers */
.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable:hover {
    background-color: #e9ecef;
}

.sort-indicator {
    font-size: 11px;
    color: #999;
    margin-left: 4px;
}

.sort-indicator.active {
    color: #4a90e2;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 8px 10px;
    }
    
    .issue-meta {
        grid-template-columns: 1fr;
    }
}
