/* Jira Client Portal - Main Stylesheet */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #172B4D;
    background-color: #f4f5f7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
header {
    background-color: #0052cc;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.sprint-name {
    font-weight: 400;
    opacity: 0.9;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.client-name {
    font-size: 0.9rem;
    opacity: 0.9;
    padding: 0.5rem 0.75rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.logout-link {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.logout-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.refresh-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-button:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.refresh-button svg {
    width: 14px;
    height: 14px;
}

/* Main content area */
main {
    flex: 1;
    width: 100%;
    padding: 1.5rem;
    overflow-x: auto;
}

/* Footer styles */
footer {
    text-align: center;
    padding: 1rem;
    color: #6B778C;
    font-size: 0.85rem;
    background-color: #fff;
    border-top: 1px solid #dfe1e6;
}

/* Error banner */
.error-banner {
    background-color: #ffebe6;
    border: 1px solid #de350b;
    color: #bf2600;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.error-banner svg {
    flex-shrink: 0;
}

/* Admin Filter */
.admin-filter {
    background-color: white;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-filter form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #172B4D;
    margin-right: 8px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    background-color: #f4f5f7;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.filter-checkbox:hover {
    background-color: #ebecf0;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0052cc;
}

.filter-checkbox input[type="checkbox"]:checked + .checkbox-label {
    color: #0052cc;
    font-weight: 600;
}

.checkbox-label {
    font-size: 13px;
    color: #42526E;
}

.filter-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
    color: #42526E;
}

.filter-btn:hover {
    background-color: #f4f5f7;
    border-color: #c1c7d0;
}

.filter-btn.select-all {
    color: #0052cc;
    border-color: #0052cc;
}

.filter-btn.select-all:hover {
    background-color: #deebff;
}

.filter-btn.clear-all {
    color: #de350b;
    border-color: #de350b;
}

.filter-btn.clear-all:hover {
    background-color: #ffebe6;
}

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 12px;
    padding: 0 0 2rem 0;
    overflow-x: auto;
    align-items: flex-start;
}

.kanban-column {
    flex: 0 0 280px;
    min-width: 280px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    background-color: #f4f5f7;
    border-radius: 6px;
    max-height: calc(100vh - 160px);
}

.column-header {
    padding: 12px 16px;
    background-color: #ebecf0;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.column-title {
    font-size: 13px;
    font-weight: 600;
    color: #172B4D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.column-count {
    background-color: #fff;
    color: #5e6c84;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.column-cards {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Kanban Card */
.kanban-card {
    background-color: white;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    cursor: pointer;
    border-left: 3px solid #0052cc;
}

.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    background-color: #fafbfc;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.card-type-key {
    display: flex;
    align-items: center;
    gap: 6px;
}

.issue-type-icon {
    font-size: 14px;
    line-height: 1;
}

.issue-key {
    font-size: 12px;
    font-weight: 700;
    color: #0052cc;
    background-color: #deebff;
    padding: 2px 6px;
    border-radius: 3px;
}

.priority-indicator {
    display: flex;
    align-items: center;
}

.priority-indicator svg {
    width: 14px;
    height: 14px;
}

.card-summary {
    font-size: 14px;
    font-weight: 500;
    color: #172B4D;
    line-height: 1.4;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.client-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.client-badge.client-oya {
    background-color: #e3fcef;
    color: #006644;
}

.client-badge.client-benchmark {
    background-color: #deebff;
    color: #0747a6;
}

.card-assignee {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #5e6c84;
    margin-left: auto;
}

.card-assignee svg {
    opacity: 0.6;
    width: 14px;
    height: 14px;
}

/* No tickets message */
.no-tickets {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    color: #6B778C;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.no-tickets svg {
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.no-tickets h3 {
    font-size: 1.25rem;
    color: #172B4D;
    margin-bottom: 0.5rem;
}

.no-tickets p {
    font-size: 0.95rem;
}

/* Login page styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    color: #172B4D;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-subtitle {
    color: #6B778C;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #172B4D;
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 2px solid #dfe1e6;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #0052cc;
    box-shadow: 0 0 0 2px rgba(0, 82, 204, 0.2);
}

.form-group input::placeholder {
    color: #97A0AF;
}

.login-button {
    background-color: #0052cc;
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 0.5rem;
}

.login-button:hover {
    background-color: #0747a6;
}

.login-button:active {
    background-color: #003d99;
}

/* Error message styles */
.error-message {
    background-color: #ffebe6;
    border: 1px solid #de350b;
    color: #bf2600;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .kanban-board {
        overflow-x: auto;
    }
    
    .kanban-column {
        min-width: 260px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .header-left {
        justify-content: center;
    }

    header h1 {
        font-size: 1rem;
        text-align: center;
    }

    .header-nav {
        justify-content: center;
        flex-wrap: wrap;
    }

    main {
        padding: 1rem;
    }

    .kanban-board {
        flex-direction: column;
        gap: 1.5rem;
    }

    .kanban-column {
        max-width: 100%;
        min-width: 100%;
    }

    .column-header {
        position: static;
    }

    .login-card {
        padding: 1.5rem;
    }

    .error-banner {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .refresh-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .header-nav {
        gap: 0.5rem;
    }

    .client-name {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .logout-link, .refresh-button {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* ============================================================
   Ticket Detail Modal
   ============================================================ */

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modalScaleUp {
    from { opacity: 0; transform: scale(0.95) translateY(-8px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.2s ease;
    padding: 1rem;
}

/* Container */
.modal-container {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    max-width: 720px;
    width: 90%;
    min-height: 200px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 4px 16px rgba(0, 0, 0, 0.12);
    animation: modalScaleUp 0.2s ease;
}

/* Close button */
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f4f5f7;
    color: #42526E;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    z-index: 10;
    flex-shrink: 0;
}

.modal-close:hover {
    background: #ebecf0;
    color: #172B4D;
}

/* Loader */
.modal-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 2rem;
    color: #42526E;
    font-size: 0.9rem;
}

.modal-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #dfe1e6;
    border-top-color: #0052cc;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error state */
.modal-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    color: #bf2600;
}

.modal-retry-btn {
    background: #0052cc;
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.modal-retry-btn:hover {
    background: #0747a6;
}

/* Modal header row */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0 24px;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-jira-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #0052cc;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid #0052cc;
    border-radius: 4px;
    transition: background 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.modal-jira-link:hover {
    background: #deebff;
}

/* Modal title */
.modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #172B4D;
    line-height: 1.4;
    padding: 12px 24px 0 24px;
    margin: 0;
}

/* Sections */
.modal-section {
    padding: 16px 24px;
    border-top: 1px solid #f0f1f3;
}

.modal-section:first-of-type {
    border-top: none;
}

.modal-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #5e6c84;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-count-badge {
    background: #dfe1e6;
    color: #42526E;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    text-transform: none;
    letter-spacing: 0;
}

/* Metadata grid */
.modal-metadata {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}

.metadata-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.metadata-item--full {
    grid-column: 1 / -1;
}

.metadata-label {
    font-size: 11px;
    font-weight: 600;
    color: #97A0AF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metadata-value {
    font-size: 13px;
    color: #172B4D;
    font-weight: 500;
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    width: fit-content;
}

.status-badge--sm {
    font-size: 10px;
    padding: 2px 7px;
}

/* Tag pills */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 22px;
    font-size: 13px;
    color: #172B4D;
}

.tag-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #deebff;
    color: #0747a6;
}

.tag-pill--component {
    background: #e3fcef;
    color: #006644;
}

/* Description */
.modal-description {
    font-size: 14px;
    color: #172B4D;
    line-height: 1.65;
}

.modal-empty-state {
    color: #97A0AF;
    font-style: italic;
    font-size: 14px;
}

.modal-description h1,
.modal-description h2,
.modal-description h3,
.modal-description h4,
.modal-description h5,
.modal-description h6 {
    color: #172B4D;
    margin: 1em 0 0.5em 0;
    line-height: 1.3;
    font-weight: 600;
}

.modal-description h1 { font-size: 1.3em; }
.modal-description h2 { font-size: 1.15em; }
.modal-description h3 { font-size: 1em; }

.modal-description p {
    margin: 0.5em 0;
}

.modal-description ul,
.modal-description ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.modal-description li {
    margin: 0.25em 0;
}

.modal-description code {
    background: #f4f5f7;
    border: 1px solid #dfe1e6;
    border-radius: 3px;
    padding: 1px 5px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875em;
    color: #172B4D;
}

.modal-description pre {
    background: #f4f5f7;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    padding: 12px 16px;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875em;
    line-height: 1.5;
    margin: 0.75em 0;
}

.modal-description pre code {
    background: none;
    border: none;
    padding: 0;
}

.modal-description blockquote {
    border-left: 3px solid #0052cc;
    margin: 0.75em 0;
    padding: 0.5em 0.75em 0.5em 1em;
    background: #f4f5f7;
    color: #42526E;
    border-radius: 0 4px 4px 0;
}

.modal-description table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75em 0;
    font-size: 0.9em;
}

.modal-description th,
.modal-description td {
    border: 1px solid #dfe1e6;
    padding: 8px 12px;
    text-align: left;
}

.modal-description th {
    background: #f4f5f7;
    font-weight: 600;
}

.modal-description a {
    color: #0052cc;
    text-decoration: none;
}

.modal-description a:hover {
    text-decoration: underline;
}

.modal-description img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Subtasks */
.subtask-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #f4f5f7;
    margin-bottom: 6px;
}

.subtask-summary {
    flex: 1;
    font-size: 13px;
    color: #172B4D;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Comments */
.comment-item {
    border: 1px solid #f0f1f3;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fafbfc;
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-author {
    font-size: 13px;
    font-weight: 700;
    color: #172B4D;
}

.comment-timestamp {
    font-size: 11px;
    color: #97A0AF;
}

.comment-body {
    font-size: 13px;
    color: #172B4D;
    line-height: 1.6;
}

.comment-body p { margin: 0.3em 0; }
.comment-body a { color: #0052cc; }
.comment-body code {
    background: #f4f5f7;
    border: 1px solid #dfe1e6;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 0.875em;
}

/* Attachments */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #f4f5f7;
    margin-bottom: 6px;
}

.attachment-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.attachment-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.attachment-filename {
    font-size: 13px;
    font-weight: 500;
    color: #172B4D;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    font-size: 11px;
    color: #97A0AF;
}

.attachment-download {
    font-size: 12px;
    font-weight: 600;
    color: #0052cc;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid #0052cc;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.attachment-download:hover {
    background: #deebff;
}

/* Responsive — mobile full-screen modal */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-container {
        width: 100%;
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
        animation: modalScaleUp 0.25s ease;
    }

    .modal-metadata {
        grid-template-columns: 1fr;
    }

    .modal-header {
        padding: 16px 16px 0 16px;
    }

    .modal-title {
        padding: 10px 16px 0 16px;
    }

    .modal-section {
        padding: 14px 16px;
    }
}
