:root {
    --primary: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-surface: #ffffff;
    --text-main: #1e293b;
    /* Slate 800 */
    --text-muted: #64748b;
    /* Slate 500 */
    --border: #e2e8f0;
    /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 0.5rem;

    --col-urgent: #fecaca;
    /* Red 200 */
    --col-urgent-text: #991b1b;
    /* Red 800 */
    --col-normal: #e2e8f0;
    /* Slate 200 */
    --col-normal-text: #334155;
    /* Slate 700 */
    --col-low: #dcfce7;
    /* Green 100 */
    --col-low-text: #166534;
    /* Green 800 */

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-body);
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    margin: 0 0 0.5em;
    color: #0f172a;
    /* Slate 900 */
}

/* Utilities */
button {
    font-family: inherit;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    background-color: white;
    border-color: var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: #f1f5f9;
    border-color: var(--primary);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text-main);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
    transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.08);
}

.hidden {
    display: none !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Layout */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

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

.header {
    background: var(--bg-surface);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
    }
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .logo {
        font-size: 1rem;
    }
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: var(--radius);
}

.nav-links button {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    transition: color 0.15s ease-out;
}

.nav-links button:hover:not(.active) {
    color: var(--text-main);
}

.nav-links button.active {
    background: white;
    color: var(--text-main);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .nav-links {
        padding: 0.2rem;
        gap: 0.25rem;
    }

    .nav-links button {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .kanban-board {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

.kanban-column {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1rem;
    min-height: 500px;
    border-top: 4px solid;
}

@media (max-width: 768px) {
    .kanban-column {
        min-height: auto;
        padding: 0.5rem;
    }
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.column-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Priority-specific Headers */
.col-blocking .column-header,
.col-urgent .column-header {
    border-bottom-color: #fca5a5;
}

.col-blocking .column-title,
.col-urgent .column-title {
    color: #991b1b;
}

.col-high .column-header,
.col-normal .column-header {
    border-bottom-color: #fed7aa;
}

.col-high .column-title,
.col-normal .column-title {
    color: #92400e;
}

.col-low .column-header {
    border-bottom-color: #86efac;
}

.col-low .column-title {
    color: #166534;
}

/* Issue Cards - Enhanced Design */
.card {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    cursor: grab;
    border-left: 4px solid #cbd5e1;
    transition: transform 0.15s ease-out, border-color 0.15s ease-out;
    overflow: hidden;
}

@media (max-width: 768px) {
    .card {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
}

.card:hover {
    transform: translateY(-1px);
}

.card:active {
    cursor: grabbing;
}

/* Priority color indicators via left border */
.card[data-priority="Blocking"],
.card[data-priority="Urgent"] {
    border-left-color: #dc2626;
}

.card[data-priority="High"],
.card[data-priority="Normal"] {
    border-left-color: #ea580c;
}

.card[data-priority="Low"] {
    border-left-color: #16a34a;
}

.card-header {
    margin-bottom: 0.75rem;
}

.card-header h3 {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f172a;
    line-height: 1.4;
    word-break: break-word;
}

.issue-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #64748b;
}

.issue-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Backwards compatibility */

/* Resolved List Cards */
.resolved-card {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    transition: transform 0.15s ease-out, border-color 0.15s ease-out;
}

@media (max-width: 768px) {
    .resolved-card {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        gap: 0.75rem;
    }
}

.resolved-card:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
}

.resolved-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #dcfce7;
    color: #166534;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .resolved-icon {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
}

.resolved-icon.pending {
    background: #f1f5f9;
    color: #64748b;
}

.resolved-content {
    flex-grow: 1;
}

.resolved-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
    .resolved-title {
        font-size: 0.9rem;
    }
}

.resolved-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .kanban-board {
        grid-template-columns: 1fr;
        /* Stack columns */
        gap: 2rem;
    }

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

    .nav-links {
        justify-content: center;
        width: 100%;
    }

    .nav-links button {
        flex: 1;
        text-align: center;
    }

    #view-detail .detail-view-card {
        padding: 1.5rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

.issue-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: #f3f4f6;
    color: #4b5563;
    font-weight: 600;
}

.tag-cloud {
    background: #e0f2fe;
    color: #0369a1;
}

.tag-dev {
    background: #f3e8ff;
    color: #7e22ce;
}

/* Detail View */
.detail-view-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 2rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    /* Slate 900, 50% */
    backdrop-filter: blur(3px);
}

.modal-content {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Auth */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-box {
    background: white;
    padding: 3rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    text-align: center;
}

/* Attachment Previews */
.attachment-preview-img {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
    object-fit: cover;
    display: block;
}

.attachment-preview-img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.attachment-preview-video {
    max-width: 300px;
    max-height: 200px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: block;
}

.attachment-link {
    display: inline-flex;
    text-decoration: none;
    color: inherit;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    vertical-align: top;
}

.attachment-file-box {
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    background: #f8fafc;
}

/* Responsive Modal */
.modal-content {
    max-width: 100% !important;
}

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

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
    }

    .modal-content > * {
        font-size: 0.9rem;
    }
}

/* Responsive Cards and Details */
@media (max-width: 768px) {
    .card {
        padding: 0.75rem;
    }

    .card-header h3 {
        font-size: 0.9rem;
    }

    .issue-meta {
        font-size: 0.75rem;
        gap: 0.25rem;
    }

    .detail-view {
        padding: 1rem;
    }
}

/* Responsive Buttons */
@media (max-width: 768px) {
    button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

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

    .btn-group button {
        width: 100%;
    }
}

/* Responsive Forms */
@media (max-width: 768px) {
    input, textarea, select {
        font-size: 16px;
        padding: 0.75rem;
    }

    label {
        font-size: 0.85rem;
    }
}