/* 
   FUTURISTIC TASK PANEL THEME - DARK NEUTRAL 
   Targeting: .side-panel
*/

/* --- VARIABLES --- */
:root {
    /* Neutral Dark Glass */
    --glass-bg: rgba(20, 20, 20, 0.4);
    --glass-border: var(--border-color, #333);
    --glass-blur: 12px;

    /* Use App Colors */
    --accent-base: var(--accent-primary, #ffffff);

    --panel-bg: var(--bg-secondary, #111111);
    --panel-bg: var(--bg-secondary, #111111);
    --input-bg: rgba(0, 0, 0, 0.3);
    --input-bg-focus: rgba(0, 245, 255, 0.1);
}

[data-theme="light"] {
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --input-bg: rgba(255, 255, 255, 0.5);
    --panel-bg: var(--bg-secondary, #ffffff);
    --input-bg-focus: rgba(0, 245, 255, 0.08);
}

/* --- BASE PANEL LAYOUT --- */
.side-panel {
    background: var(--panel-bg) !important;
    color: var(--text-primary, #ffffff);
    font-family: 'Inter', system-ui, sans-serif;
}

/* Full Screen Variant */
.side-panel.full-screen {
    background: var(--bg-primary, #000000) !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    right: auto !important;
    border-left: none !important;
    box-shadow: none !important;
}


/* --- GRID LAYOUT (3 Columns: Main | Meta | Activity) --- */
.side-panel.full-screen .task-panel-grid {
    display: grid;
    grid-template-columns: 1fr 300px 350px;
    /* Main | Meta | Activity */
    gap: 1.5rem;
    padding: 3.5rem 2rem 1.5rem;
    max-width: none;
    margin: 0;
    align-items: start;
    height: 100%;
    overflow-y: auto;
}

/* Main Content (Title/Desc/Att) */
.side-panel.full-screen .task-panel-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Sidebar Meta (Status/Assignees/etc) */
.side-panel.full-screen .task-panel-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Activity (Comments) */
.side-panel.full-screen .task-panel-activity {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
}


/* Standard Sidebar Mode (Not full screen) - Stacked */
.side-panel:not(.full-screen) .task-panel-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
}


/* --- SECTIONS (CARDS) --- */
.panel-section {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));

    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    margin-bottom: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    /* Ensure z-index works */
    transition: all 0.2s ease;
}

.panel-section:hover {
    border-color: var(--border-color);
    background: var(--bg-tertiary);
}

/* Section Labels */
.panel-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary, #888);
    font-weight: 600;
    margin-bottom: 0.75rem;
}


/* --- INPUTS & CONTROLS --- */
.panel-input,
.panel-textarea,
.panel-select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-primary, #fff);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.panel-input:hover,
.panel-textarea:hover,
.panel-select:hover {
    background: var(--input-bg-focus);
}

.panel-input:focus,
.panel-textarea:focus,
.panel-select:focus {
    outline: none;
    background: var(--input-bg-focus);
    border-color: var(--accent-primary, #666);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

/* Title Input */
.section-title .panel-input {
    font-size: 1.75rem;
    font-weight: 700;
    background: transparent;
    padding: 0;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}

.section-title .panel-input:focus {
    background: transparent;
    border-bottom-color: var(--accent-primary, #fff);
    box-shadow: none;
}


/* --- COMPONENT STYLES --- */

/* Markdown Content */
.markdown-content,
.comment-body {
    min-height: 60px;
    line-height: 1.6;
    color: var(--text-primary, #ddd);
}

.markdown-content img,
.comment-body img {
    max-width: 100%;
    max-height: 500px;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
    margin: 1rem 0;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.2);
}


/* ASSIGNEES & AVATARS */
.assignee-list {
    display: flex;
    flex-wrap: wrap;
    /* Ensure they flow horizontally */
    gap: 0.5rem;
    align-items: flex-start;
    /* Prevent stretching height */
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-primary, #555);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border: none;
}

.assignee-chip {
    width: fit-content;
    /* Fix: prevent full width */
    display: inline-flex;
    /* Ensure inline behavior */
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 14px 5px 5px;
    /* Slightly larger padding */
    border-radius: 20px;
    font-size: 0.9rem;
    /* Larger font size */
    border: 1px solid rgba(255, 255, 255, 0.05);
    gap: 10px;
}

.remove-assignee {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.remove-assignee:hover {
    opacity: 1;
    color: #ff4d4d;
}


/* LABELS & DOTS */
.label-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}

.label-pill {
    width: fit-content;
    /* Fix: prevent full width */
    display: inline-flex;
    padding: 6px 14px;
    /* Slightly larger */
    border-radius: 6px;
    font-size: 0.9rem;
    /* Larger font */
    font-weight: 600;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}


/* ATTACHMENTS */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.attachment-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.attachment-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
    flex: 1;
}

.attachment-link {
    color: var(--text-primary, #ddd);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.attachment-link:hover {
    text-decoration: underline;
    color: #fff;
}

.attachment-meta {
    font-size: 0.75rem;
    color: var(--text-secondary, #888);
    display: flex;
    gap: 0.5rem;
}

.attachment-delete {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.attachment-delete:hover {
    opacity: 1;
    color: #ff4d4d;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 4px;
}

.attachment-upload .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px dashed var(--border-color, #444);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
    font-size: 0.9rem;
    gap: 8px;
}

.attachment-upload .btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}


/* DROPDOWNS */
.assignee-controls,
.label-controls {
    position: relative;
    /* Anchor for absolute menu */
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 220px;
    overflow: hidden;
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary, #ccc);
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--input-bg-focus);
    color: var(--text-primary);
}

.dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 1px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color, #333);
    margin: 0.5rem 0;
}

/* Create Label Form inside Dropdown */
.create-label-form {
    padding: 1rem;
}

.create-label-form .label-input {
    margin-bottom: 0.75rem;
}

.color-picker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.2);
}

.btn-create-label {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    background: var(--accent-primary, #00f);
    color: #fff;
    cursor: pointer;
}

.side-panel .btn-add {
    background: transparent;
    border: 1px dashed var(--border-color, #444);
    color: var(--text-secondary, #888);
    padding: 8px 16px;
    /* Larger hit area */
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.side-panel .btn-add:hover {
    border-color: var(--accent-primary, #fff);
    color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.05);
}


/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1200px) {
    .side-panel.full-screen .task-panel-grid {
        grid-template-columns: 1fr 300px;
    }

    .side-panel.full-screen .task-panel-activity {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .side-panel.full-screen .task-panel-grid {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
}


/* --- STANDARDIZED ICON BUTTONS --- */
.btn-icon {
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: var(--accent-primary, #00f5ff);
}

.btn-icon svg {
    stroke: currentColor;
    transition: stroke 0.2s ease;
}

.btn-icon:hover {
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.1));
    border-color: var(--border-color, rgba(255, 255, 255, 0.1));
}