/* DataSoft Bug Tracker - Frontend Styles */

.dst-bug-list {
    overflow-x: auto;
    margin: 20px 0;
}

.dst-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dst-table th,
.dst-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.dst-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.dst-table tbody tr:hover {
    background: #fafafa;
}

/* Badges */
.dst-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Status badges */
.dst-status-badge-open        { background: #e3f2fd; color: #1565c0; }
.dst-status-badge-in_progress { background: #fff3e0; color: #e65100; }
.dst-status-badge-waiting_client { background: #fff3e0; color: #e65100; } /* shows same as In Progress */
.dst-status-badge-fixed       { background: #e8f5e9; color: #2e7d32; }
.dst-status-badge-closed      { background: #f3e5f5; color: #6a1b9a; }
.dst-status-badge-wont_fix    { background: #fce4ec; color: #880e4f; }
.dst-status-badge-duplicate   { background: #eceff1; color: #455a64; }

/* Priority badges */
.dst-priority-critical { background: #ffebee; color: #b71c1c; }
.dst-priority-high     { background: #fff3e0; color: #bf360c; }
.dst-priority-medium   { background: #fffde7; color: #f57f17; }
.dst-priority-low      { background: #f1f8e9; color: #558b2f; }

/* Type badges */
.dst-type-bug         { background: #ffebee; color: #c62828; }
.dst-type-feature     { background: #e8eaf6; color: #283593; }
.dst-type-improvement { background: #e0f7fa; color: #00695c; }
.dst-type-question    { background: #fce4ec; color: #880e4f; }

/* Notice */
.dst-notice {
    padding: 14px 18px;
    border-left: 4px solid #2196f3;
    background: #e3f2fd;
    margin: 20px 0;
    border-radius: 2px;
}
.dst-notice-warning {
    border-color: #ff9800;
    background: #fff3e0;
}
.dst-notice-error {
    border-color: #f44336;
    background: #ffebee;
}
.dst-notice p { margin: 0; }

/* Submit wrapper */
.dst-submitting-as {
    background: #f5f5f5;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Changelog */
.dst-changelog { margin: 20px 0; }
.dst-version-heading {
    font-size: 18px;
    font-weight: 700;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 6px;
    margin: 24px 0 12px;
}
.dst-changelog-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dst-changelog-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

/* Expandable rows */
.dst-title-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #1a56db;
    text-decoration: none;
    font-weight: 600;
}
.dst-title-toggle:hover { text-decoration: underline; }

.dst-toggle-arrow {
    display: inline-block;
    font-size: 10px;
    transition: transform 0.2s ease;
    color: #888;
    flex-shrink: 0;
}
.dst-row-expanded .dst-toggle-arrow {
    transform: rotate(90deg);
    color: #1a56db;
}

.dst-expand-row { display: none !important; }
.dst-expand-row.dst-open { display: table-row !important; }

.dst-expand-row td {
    background: #f8f9ff;
    border-bottom: 2px solid #c5cae9;
    border-top: none;
    padding: 16px 20px 20px;
}

.dst-expand-inner {
    max-width: 900px;
}
.dst-expand-inner h4 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
}
.dst-expand-inner h4:not(:first-child) {
    margin-top: 16px;
}
.dst-expand-body {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
    margin: 0;
}
.dst-expand-steps {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
    margin: 0;
    padding-left: 18px;
}

/* Keep hover off expand row */
.dst-expand-row:hover { background: #f8f9ff !important; }

/* Sortable column headers — frontend */
.dst-table th a.dst-sort-link {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.dst-table th a.dst-sort-link:hover { text-decoration: underline; }
.dst-table th.dst-sorted { background: #e8eaf6; }
.dst-sort-idle { opacity: 0.35; font-size: 11px; }

/* Frontend filter bar */
.dst-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}
.dst-filter-bar select {
    height: 32px;
    padding: 0 28px 0 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    min-width: 140px;
}
.dst-filter-submit {
    height: 32px;
    padding: 0 14px;
    background: #1a56db;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
}
.dst-filter-submit:hover { background: #1044b5; }
.dst-filter-reset {
    font-size: 13px;
    color: #666;
    text-decoration: none;
    padding: 0 4px;
}
.dst-filter-reset:hover { color: #333; }

/* Built-in submit form */
.dst-submit-form { max-width: 820px; margin-top: 16px; }
.dst-form-row { margin-bottom: 16px; }
.dst-form-row label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}
.dst-form-row label small { font-weight: 400; color: #777; }
.dst-required { color: #d9534f; }
.dst-form-row .dst-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}
.dst-form-row select.dst-input { height: 38px; }
.dst-form-row textarea.dst-input { resize: vertical; }
.dst-form-row .dst-input:focus { outline: none; border-color: #1a56db; box-shadow: 0 0 0 2px rgba(26,86,219,0.15); }

/* Two-column layout for short fields */
@media (min-width: 600px) {
    .dst-submit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
    .dst-form-row-full  { grid-column: 1 / -1; }
    .dst-form-row-half  { grid-column: span 1; }
}

.dst-submit-btn {
    background: #1a56db;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.dst-submit-btn:hover    { background: #1044b5; }
.dst-submit-btn:disabled { background: #aaa; cursor: default; }

.dst-notice-success { border-color: #2e7d32; background: #e8f5e9; color: #1b5e20; }

/* File upload field */
.dst-input-file {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 0;
    font-size: 14px;
}
.dst-field-hint {
    margin: 4px 0 0;
    font-size: 12px;
    color: #888;
}

/* Changelog enhancements */
.dst-cl-meta {
    font-size: 13px;
    color: #666;
    margin: 0 0 10px;
}

/* Highlight logged-in user's own issues */
.dst-cl-mine {
    background-color: #e8f4fd !important;
}
.dst-cl-mine:hover {
    background-color: #d4eaf8 !important;
}

/* "Your Issue" badge */
.dst-mine-badge {
    display: inline-block;
    background: #1a56db;
    color: #fff;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    vertical-align: middle;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Changelog filter bar label */
.dst-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
}

/* Pagination */
.dst-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 16px;
    align-items: center;
}
.dst-page-btn {
    display: inline-block;
    min-width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    padding: 0 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-decoration: none;
    font-size: 13px;
    color: #333;
    background: #fff;
    transition: background 0.15s, border-color 0.15s;
}
.dst-page-btn:hover {
    background: #f0f0f0;
    border-color: #999;
    color: #333;
    text-decoration: none;
}
.dst-page-btn.dst-page-active {
    background: #1a56db;
    border-color: #1a56db;
    color: #fff;
    font-weight: 700;
    cursor: default;
}

/* Issue list filter bar */
.dst-il-filter-bar {
    flex-wrap: wrap;
    row-gap: 8px;
}

/* Status summary tiles */
.dst-il-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 16px;
}
.dst-il-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    min-width: 80px;
    border: 2px solid transparent;
    transition: border-color 0.15s, opacity 0.15s;
}
.dst-il-tile:hover { border-color: rgba(0,0,0,0.2); text-decoration: none; }
.dst-il-tile-active { border-color: rgba(0,0,0,0.35) !important; }
.dst-il-count {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}
.dst-il-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 3px;
}
.dst-il-tile.dst-status-open        { background: #e3f2fd; color: #1565c0; }
.dst-il-tile.dst-status-in_progress { background: #fff3e0; color: #e65100; }
.dst-il-tile.dst-status-fixed       { background: #e8f5e9; color: #2e7d32; }
.dst-il-tile.dst-status-closed      { background: #f3e5f5; color: #6a1b9a; }
.dst-il-tile.dst-status-wont_fix    { background: #fce4ec; color: #880e4f; }
.dst-il-tile.dst-status-duplicate   { background: #eceff1; color: #455a64; }

/* Sort arrows */
.dst-sort-asc  { font-size: 10px; color: #1a56db; }
.dst-sort-desc { font-size: 10px; color: #1a56db; }

/* Column sizing */
.dst-col-id   { width: 50px; }
.dst-col-date { white-space: nowrap; }
.dst-col-title { min-width: 200px; }

/* Pagination ellipsis */
.dst-page-ellipsis {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 4px;
    color: #999;
    font-size: 14px;
}

/* Mine badge on issue list */
.dst-cl-mine td { background-color: #e8f4fd !important; }
