/* ==========================================================================
   USER-MODERN.CSS — User portal for KING IT
   Same dark navy / orange glassmorphism theme as admin-modern.css
   Uses adm- classes where possible, adds usr- prefix for user-specific
   ========================================================================== */

/* ──────────────── USER LAYOUT ──────────────── */
.usr-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2.5rem;
    min-height: 100vh;
    overflow-x: hidden;
    box-sizing: border-box;
}

.usr-page-header {
    margin-bottom: 2rem;
}

.usr-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.25rem;
}

.usr-page-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
}

/* ──────────────── DASHBOARD GRID ──────────────── */
.usr-dash-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.usr-dash-grid > * {
    min-width: 0;
}

.usr-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ──────────────── NOTIFICATION CARDS ──────────────── */
.usr-notification-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 520px;
    overflow-y: auto;
}

.usr-notification-card {
    display: block;
    padding: 1rem;
    background: rgba(14, 20, 40, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.usr-notification-card:hover {
    background: rgba(252, 163, 17, 0.06);
    border-color: rgba(252, 163, 17, 0.2);
}

.usr-notification-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
    overflow-wrap: anywhere;
}

.usr-notification-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.35rem;
}

.usr-notification-message {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    overflow-wrap: anywhere;
}

/* ──────────────── PROJECT PREVIEW CARDS ──────────────── */
.usr-project-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.usr-project-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(20, 33, 61, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.usr-project-card:hover {
    background: rgba(252, 163, 17, 0.06);
    border-color: rgba(252, 163, 17, 0.2);
}

.usr-project-card > div:first-child {
    min-width: 0;
    overflow: hidden;
}

.usr-project-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.25rem;
    overflow-wrap: anywhere;
}

.usr-project-card-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    overflow-wrap: anywhere;
}

.usr-project-card-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.usr-new-badge {
    display: inline-flex;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(252, 163, 17, 0.2);
    color: #FCA311;
}

/* ──────────────── ACTIVITY COLUMNS ──────────────── */
.usr-activity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.usr-activity-grid > * {
    min-width: 0;
}

.usr-activity-card {
    display: block;
    padding: 1rem;
    background: rgba(14, 20, 40, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.usr-activity-card:hover {
    background: rgba(252, 163, 17, 0.06);
    border-color: rgba(252, 163, 17, 0.2);
}

.usr-activity-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.35rem;
    overflow-wrap: anywhere;
}

.usr-activity-card-status {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 0.25rem;
}

.usr-activity-card-date {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
}

.usr-activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ──────────────── STAGE PROGRESS BAR ──────────────── */
.usr-stage-bar-wrap {
    margin-bottom: 1rem;
}

.usr-stage-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.usr-stage-fill {
    height: 100%;
    background: linear-gradient(90deg, #FCA311, #fbbf24);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.usr-stage-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

.usr-stage-desc {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.75rem 1rem;
    background: rgba(14, 20, 40, 0.3);
    border-radius: 0.5rem;
}

/* ──────────────── QUICK ACTIONS ──────────────── */
.usr-quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* ──────────────── QUOTE PANEL ──────────────── */
.usr-quote-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FCA311;
    margin: 0.5rem 0;
}

.usr-quote-status {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}

.usr-quote-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* ──────────────── COMMENT/NOTE LIST ──────────────── */
.usr-note-form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.usr-note-form .adm-form-textarea {
    flex: 1;
}

.usr-note-card {
    padding: 1rem;
    background: rgba(14, 20, 40, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    transition: border-color 0.2s ease;
}

.usr-note-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.usr-note-card.admin-note {
    border-left: 3px solid #FCA311;
}

.usr-note-card.user-note {
    border-left: 3px solid #60a5fa;
}

.usr-note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.usr-note-author {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.usr-note-time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
}

.usr-note-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

.usr-notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ──────────────── MODAL STYLING (extends adm-modal) ──────────────── */
.usr-modal .modal-content {
    background: rgba(14, 20, 40, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(252, 163, 17, 0.15);
    border-radius: 1rem;
    color: #fff;
}

.usr-modal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem 1.5rem;
}

.usr-modal .modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.usr-modal .modal-body {
    padding: 1.5rem;
}

.usr-modal .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 1.5rem;
}

.usr-modal .btn-close {
    filter: invert(1);
    opacity: 0.5;
}

.usr-modal .btn-close:hover {
    opacity: 1;
}

.usr-modal-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.usr-modal-col-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 0.75rem;
}

.usr-modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.usr-modal-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(14, 20, 40, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
}

.usr-modal-list li span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.usr-modal-list-remove {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 6px;
    color: #f87171;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.usr-modal-list-remove:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

/* ──────────────── IMPORTANCE BADGES ──────────────── */
.usr-importance-1 { color: #4ade80; }
.usr-importance-2 { color: #60a5fa; }
.usr-importance-3 { color: #fbbf24; }
.usr-importance-4 { color: #fb923c; }
.usr-importance-5 { color: #f87171; font-weight: 700; }

/* ──────────────── STATUS BADGES (user) ──────────────── */
.usr-status-new { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.usr-status-quoted { background: rgba(252, 163, 17, 0.2); color: #FCA311; }
.usr-status-active { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.usr-status-implemented { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.usr-status-rejected { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.usr-status-solved { background: rgba(34, 197, 94, 0.2); color: #4ade80; }

/* ──────────────── MOBILE BACK BUTTON ──────────────── */
.usr-back-btn {
    display: none;
}

/* ──────────────── RESPONSIVE ──────────────── */
@media (max-width: 1024px) {
    .usr-back-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        position: sticky;
        top: 0;
        z-index: 100;
        margin: -1.25rem -1.25rem 1.25rem;
        padding: 0.7rem 1.25rem;
        background: rgba(6, 6, 18, 0.8);
        backdrop-filter: blur(20px) saturate(1.3);
        -webkit-backdrop-filter: blur(20px) saturate(1.3);
        border-bottom: 1px solid rgba(252, 163, 17, 0.12);
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.85rem;
        font-weight: 600;
        text-decoration: none;
        letter-spacing: 0.01em;
        transition: color 0.25s ease, background 0.25s ease;
    }

    .usr-back-btn:hover {
        color: #FCA311;
        background: rgba(6, 6, 18, 0.9);
    }
    .usr-wrapper {
        padding: 1.25rem;
    }

    .usr-dash-grid {
        grid-template-columns: 1fr;
    }

    .usr-activity-grid {
        grid-template-columns: 1fr;
    }

    .usr-modal-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .usr-back-btn {
        margin: -0.75rem -0.75rem 0.75rem;
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
    }

    .usr-wrapper {
        padding: 0.75rem;
    }

    .usr-page-title {
        font-size: 1.2rem;
    }

    .usr-page-subtitle {
        font-size: 0.78rem;
    }

    .usr-page-header {
        margin-bottom: 1.25rem;
    }

    .usr-dash-grid {
        gap: 1rem;
    }

    .usr-notification-list {
        max-height: 320px;
    }

    .usr-project-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .usr-project-card-right {
        width: 100%;
        justify-content: flex-start;
    }

    .usr-project-card-meta {
        word-break: break-word;
    }

    .usr-activity-grid {
        gap: 1rem;
    }

    .usr-quick-actions {
        flex-direction: column;
    }

    .usr-quote-actions {
        flex-direction: column;
    }

    .usr-note-form {
        flex-direction: column;
    }

    .usr-note-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }

    .usr-stage-labels {
        font-size: 0.6rem;
    }

    .usr-wrapper .adm-card {
        padding: 1rem;
        overflow: auto;
    }

    .usr-wrapper .adm-card-header {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .usr-wrapper .adm-filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .usr-wrapper .adm-filter-tab {
        flex-shrink: 0;
        font-size: 0.75rem;
        padding: 0.4rem 0.85rem;
    }

    .usr-wrapper .adm-form-input {
        font-size: 0.8rem;
    }
}
