﻿/* =========================
   CARDS
   ========================= */
.card,
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: 0.2s ease;
   
}

    .card:hover,
    .section-card:hover {
        border-color: var(--accent);
    }


/* =========================
   BUTTONS
   ========================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .btn:hover {
        background: var(--bg-hover);
    }

.btn-primary {
    background: var(--accent);
    border: none;
    color: white;
}

    .btn-primary:hover {
        background: var(--accent-hover);
    }

.btn-success {
    background: var(--success);
    border: none;
    color: white;
}

.btn-danger {
    background: var(--danger);
    border: none;
    color: white;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

    .btn-outline:hover {
        background: var(--bg-hover);
    }

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}


/* =========================
   INPUTS / FORMS
   ========================= */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-control,
.form-select,
textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 0.5rem;
    transition: 0.2s ease;
}

    .form-control:focus,
    .form-select:focus,
    textarea:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
    }


/* =========================
   TABLES
   ========================= */
.table {
    width: 100%;
    border-collapse: collapse;
}

    .table th {
        background: var(--bg-secondary);
        color: var(--text-secondary);
        padding: 0.5rem;
        font-size: 0.85rem;
        text-align: left;
    }

    .table td {
        padding: 0.5rem;
        border-bottom: 1px solid var(--border);
    }

    .table tr:hover {
        background: rgba(255,255,255,0.03);
    }


/* =========================
   BADGES
   ========================= */
.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16,185,129,0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(245,158,11,0.2);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239,68,68,0.2);
    color: var(--danger);
}


/* =========================
   MODALS
   ========================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999 !important;
}

/* Simple standalone modal (no .modal-dialog child) */
.modal:not(:has(.modal-dialog)) {
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    min-width: 400px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-md);
}

.modal:not(:has(.modal-dialog)) .modal-header {
    font-weight: 600;
    margin-bottom: 1rem;
}

.modal:not(:has(.modal-dialog)) .modal-footer {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Bootstrap-style modals (ConfirmDialog, Team Management, etc.) */
.modal.app-bs-modal,
.modal.show:has(.modal-dialog) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1055 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-width: 0 !important;
    padding: 0.5rem !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

.modal.app-bs-modal .modal-dialog {
    margin: 0 auto !important;
    max-height: calc(100vh - 1rem);
}

.modal.app-bs-modal .modal-content {
    max-height: calc(100vh - 1rem);
    display: flex;
    flex-direction: column;
}

.modal.app-bs-modal .modal-body {
    overflow-y: auto;
}

.modal-backdrop.show {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1050 !important;
}

html.modal-scroll-lock,
html.modal-scroll-lock body {
    overflow: hidden !important;
}

html.modal-scroll-lock .main-content,
html.modal-scroll-lock .page-content {
    overflow: hidden !important;
}

/* Bootstrap modal dark override (ConfirmDialog + other app modals) */
.modal-content.confirm-dialog {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid #475569 !important;
}

.modal-content.confirm-dialog .modal-title {
    color: #f8fafc !important;
}

.modal-content.confirm-dialog .modal-body p {
    color: #cbd5e1 !important;
}

.confirm-dialog-btn-cancel {
    height: 38px;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    background: transparent !important;
    border: 1px solid #64748b !important;
    color: #e2e8f0 !important;
    cursor: pointer;
}

.confirm-dialog-btn-cancel:hover {
    background: #334155 !important;
    border-color: #94a3b8 !important;
    color: #f8fafc !important;
}

.confirm-dialog-btn-danger {
    height: 38px;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    background: #dc2626 !important;
    border: 1px solid #b91c1c !important;
    color: #fff !important;
    font-weight: 600;
    cursor: pointer;
}

.confirm-dialog-btn-danger:hover {
    background: #b91c1c !important;
    border-color: #991b1b !important;
    color: #fff !important;
}

.team-members-modal-dialog {
    max-width: 1300px !important;
    width: 92vw !important;
}


/* =========================
   DROPDOWNS
   ========================= */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    padding: 0.25rem;
    min-width: 150px;
    z-index: 1000;
}

.dropdown-item {
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
}

    .dropdown-item:hover {
        background: var(--bg-hover);
    }


/* =========================
   ALERTS
   ========================= */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.alert-success {
    background: rgba(16,185,129,0.15);
    color: var(--success);
}

.alert-danger {
    background: rgba(239,68,68,0.15);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245,158,11,0.15);
    color: var(--warning);
}


/* =========================
   LIST GROUP
   ========================= */
.list-group {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.list-group-item {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

    .list-group-item:last-child {
        border-bottom: none;
    }

    .list-group-item:hover {
        background: var(--bg-hover);
    }


/* =========================
   SPINNERS / LOADING
   ========================= */
.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
}



/* =========================
   SEARCH CARD
   ========================= */
.section-card {
    max-width: 900px;
    margin: 0 auto;
}

    /* =========================
   SEARCH INPUT
   ========================= */
    .section-card input.form-control {
        height: 44px;
        border-radius: 8px;
        font-size: 14px;
    }

    /* =========================
   ACTION BUTTON GROUP
   ========================= */
    .section-card .btn-primary {
        min-width: 160px;
    }

/* =========================
   TABLE (DARK FIX)
   ========================= */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

    .table th {
        background: var(--bg-secondary);
        color: var(--text-secondary);
        padding: 0.65rem;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .table td {
        padding: 0.6rem;
        border-bottom: 1px solid var(--border);
        font-size: 0.9rem;
    }

    .table tr:hover {
        background: rgba(255,255,255,0.03);
        cursor: pointer;
    }

/* clickable rows */
.clickable-row {
    transition: background 0.15s ease;
}

    .clickable-row:hover {
        background: rgba(59,130,246,0.12);
    }

/* =========================
   TABLE CONTAINER
   ========================= */
.sprint-table-container {
    margin-top: 1rem;
    border-radius: 10px;
    overflow: hidden;
}


/* =========================
   FORCE DARK TABLE OVERRIDE
   ========================= */
.table {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

    .table th {
        background-color: var(--bg-secondary) !important;
        color: var(--text-secondary) !important;
    }

    .table td {
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
    }



/* =========================
   ICON BUTTONS
   ========================= */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
}

    .icon-btn:hover {
        background: var(--bg-hover);
    }

/* =========================
   QUILL EDITOR (IMPROVED DARK)
   ========================= */
/* wrapper feel (adds depth) */
.ql-toolbar,
.ql-container {
    max-width: 100%;
}

/* =========================
   TOOLBAR
   ========================= */
.ql-toolbar {
    background: #1e293b; /* darker than input */
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    padding: 6px 8px;
}

    /* buttons */
    .ql-toolbar button {
        border-radius: 6px;
        transition: all 0.15s ease;
    }

    /* icons */
    .ql-toolbar .ql-stroke {
        stroke: #94a3b8;
    }

    .ql-toolbar .ql-fill {
        fill: #94a3b8;
    }

    /* hover */
    .ql-toolbar button:hover {
        background: #334155;
    }

    /* active */
    .ql-toolbar button.ql-active {
        background: rgba(59,130,246,0.2);
    }

        .ql-toolbar button.ql-active .ql-stroke {
            stroke: var(--accent);
        }

        .ql-toolbar button.ql-active .ql-fill {
            fill: var(--accent);
        }

/* dropdown */
.ql-picker {
    color: #cbd5e1;
}

.ql-picker-options {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* =========================
   EDITOR CONTAINER
   ========================= */
.ql-container {
    background: #334155; /* slightly lighter for contrast */
    border: 1px solid var(--border);
    border-radius: 0 0 10px 10px;
    color: var(--text-primary);
}

/* editor content */
.ql-editor {
    min-height: 160px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
}

    /* placeholder */
    .ql-editor.ql-blank::before {
        color: #94a3b8;
        font-style: normal;
    }

    /* links */
    .ql-editor a {
        color: var(--accent);
    }




/* =========================
   FOCUS STATE (important)
   ========================= */
.ql-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
}

/* =========================
   SCROLLBAR
   ========================= */
.ql-container::-webkit-scrollbar {
    width: 8px;
}

.ql-container::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}
.ql-toolbar .ql-stroke {
    stroke: #e2e8f0 !important;
}

.ql-toolbar .ql-fill {
    fill: #e2e8f0 !important;
}

/* =========================
   BLAZORED TOAST — dark mode
   ========================= */
.blazored-toast {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid #475569 !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45) !important;
}

.blazored-toast-message {
    color: #f1f5f9 !important;
}

.blazored-toast-close-icon,
.blazored-toast-close-icon svg {
    color: #94a3b8 !important;
    fill: #94a3b8 !important;
}

.blazored-toast-success,
.success-toast-override {
    border-left: 4px solid #10b981 !important;
}

.blazored-toast-error,
.error-toast-override {
    border-left: 4px solid #ef4444 !important;
}

.blazored-toast-warning,
.warning-toast-override {
    border-left: 4px solid #f59e0b !important;
}

.blazored-toast-info,
.info-toast-override {
    border-left: 4px solid #3b82f6 !important;
}

.blazored-toast-progressbar {
    background-color: rgba(148, 163, 184, 0.25) !important;
}

.blazored-toast-progressbar > span {
    background-color: #60a5fa !important;
}

/* =========================
   FILE DROP ZONE (shared FileDropZone component)
   Global (non-scoped) so styles reach the InputFile-rendered <input>.
   ========================= */
.fdz {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 120px;
    padding: 1.25rem;
    border: 2px dashed var(--border, #475569);
    border-radius: 10px;
    background: var(--bg-input, #1e293b);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.fdz:hover,
.fdz.fdz-dragover {
    border-color: var(--accent, #3b82f6);
    background: var(--bg-hover, rgba(59, 130, 246, 0.08));
}

.fdz.fdz-dragover {
    border-style: solid;
}

.fdz.is-busy {
    justify-content: center;
    opacity: 0.85;
}

/* Native file input overlays the whole zone so both click and drag-drop work */
.fdz input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
    z-index: 2;
}

.fdz input[type="file"]:disabled {
    cursor: default;
}

/* Left-justified file browse control */
.fdz-browse {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

/* Centered drag & drop context, centered within the whole box */
.fdz-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    color: var(--text-secondary, #94a3b8);
    padding: 0 1rem;
}

.fdz-icon {
    font-size: 1.75rem;
    color: var(--accent, #3b82f6);
    margin-bottom: 0.5rem;
}

.fdz-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
}

.fdz-hint {
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    margin-top: 0.15rem;
}

.fdz-status {
    pointer-events: none;
    color: var(--text-secondary, #94a3b8);
}

/* Compact variant for tight spaces / grid cells */
.fdz-compact {
    min-height: 40px;
    padding: 0.35rem 0.6rem;
}

.fdz-compact .fdz-browse {
    display: none;
}

.fdz-compact .fdz-content {
    flex-direction: row;
    gap: 0.4rem;
}

.fdz-compact .fdz-content .fdz-icon {
    font-size: 1rem;
    margin-bottom: 0;
}

/* =========================
   IMAGE UPLOAD PREVIEW (thumbnail below drop zone)
   ========================= */
.img-upload-preview {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem;
}

.img-upload-preview-thumb-btn {
    display: block;
    padding: 0;
    border: 2px solid var(--border, #475569);
    border-radius: 8px;
    background: var(--bg-card, #1e293b);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.img-upload-preview-thumb-btn:hover {
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.img-upload-preview-thumb {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: cover;
    background: #fff;
}

.img-upload-preview-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-self: center;
}

.img-upload-preview-loading {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.875rem;
    align-items: center;
}

/* =========================
   ATTACHMENT THUMBNAIL GRID (multi-file uploads)
   ========================= */
.attachment-thumb-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.attachment-thumb-item {
    width: 96px;
    text-align: center;
    position: relative;
}

.attachment-thumb-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ef4444;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: all 0.15s ease;
}

.attachment-thumb-remove:hover {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff;
}

.attachment-thumb-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    padding: 0;
    border: 1px solid var(--border, #475569);
    border-radius: 8px;
    background: var(--bg-card, #1e293b);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.attachment-thumb-frame:hover,
button.attachment-thumb-frame:hover {
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.attachment-thumb-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #fff;
}

.attachment-thumb-frame .attachment-thumb-icon {
    font-size: 2rem;
    color: var(--text-secondary, #94a3b8);
}

.attachment-thumb-name {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--text-secondary, #94a3b8);
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}