/* Project Selector */
.project-selector-card {
    margin-bottom: 1.5rem;
}

.project-selector-content {
    padding: 1rem 1.5rem 1.5rem;
    position: relative;
    min-height: 80px;
}

.project-selector-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: end;
}

.project-dropdown-wrapper {
    max-width: 500px;
    position: relative;
}

.project-dropdown-wrapper .filter-label,
.max-results-wrapper .filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.project-selector-dropdown {
    width: 100%;
}

.max-results-wrapper {
    min-width: 180px;
}

.max-results-dropdown {
    width: 100%;
}

/* Fix LoadingPanel overflow */
.project-selector-content ::deep .dxbl-loading-panel {
    position: relative !important;
}

.project-selector-content ::deep .dxbl-loading-panel-content {
    position: relative !important;
}

/* Project Details */
.project-details-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-info-card {
    background: #667eea;
    color: white;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    flex-wrap: wrap;
}

.project-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-avatar-large i {
    font-size: 2.5rem;
    color: white;
}

.project-title-info {
    flex: 1;
}

.project-title-info h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
}

.project-key-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.project-actions {
    display: flex;
    gap: 0.75rem;
}

.project-info-card ::deep .dxbl-btn-secondary {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

.project-info-card ::deep .dxbl-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* Statistics Grid */
.project-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 1.5rem;
    color: white;
}

.stat-icon.total {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-icon.open {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-icon.in-progress {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-icon.done {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Issue Type Stats */
.issue-type-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.issue-type-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.issue-type-stat i {
    font-size: 1.25rem;
}

.issue-type-stat.epic i {
    color: #904ee2;
}

.issue-type-stat.story i {
    color: #63ba3c;
}

.issue-type-stat.task i {
    color: #4bade8;
}

.issue-type-stat .count {
    font-weight: 700;
    font-size: 1.25rem;
    color: #1f2937;
}

.issue-type-stat .label {
    color: #6b7280;
    font-size: 0.875rem;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.5rem;
}

/* Hierarchy View */
.hierarchy-container {
    padding: 1rem;
}

.hierarchy-epic {
    margin-bottom: 0.5rem;
}

.hierarchy-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.hierarchy-item:hover {
    background: #f3f4f6;
}

.hierarchy-item.expanded {
    background: #f0f9ff;
}

.expand-icon {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.issue-type-indicator {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.issue-type-indicator img {
    width: 16px;
    height: 16px;
}

.issue-type-indicator.epic {
    background: #f3e8ff;
    color: #904ee2;
}

.issue-type-indicator.story {
    background: #dcfce7;
    color: #63ba3c;
}

.issue-type-indicator.task {
    background: #dbeafe;
    color: #4bade8;
}

.hierarchy-item .issue-key {
    font-weight: 600;
    color: #6366f1;
    text-decoration: none;
    min-width: 80px;
}

.hierarchy-item .issue-key:hover {
    text-decoration: underline;
}

.hierarchy-item .issue-summary {
    flex: 1;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hierarchy-item .children-count {
    font-size: 0.75rem;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

.hierarchy-children {
    margin-left: 1.5rem;
    border-left: 2px solid #e5e7eb;
    padding-left: 0.5rem;
}

.hierarchy-story {
    margin-bottom: 0.25rem;
}

.task-item.direct {
    margin-left: 0;
}

.assignee-mini {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
}

.assignee-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Orphan Items */
.hierarchy-orphans {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed #e5e7eb;
}

.orphans-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.orphan-item {
    opacity: 0.7;
}

.show-more-btn {
    background: none;
    border: none;
    color: #6366f1;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 2rem;
}

.show-more-btn:hover {
    text-decoration: underline;
}

/* Card Headers */
.card-header-with-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-title i {
    font-size: 1.25rem;
    color: #6366f1;
}

.card-title h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.card-header-with-actions .card-title {
    padding: 0;
    border-bottom: none;
}

/* Assignees Grid */
.assignees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1rem 1.5rem;
}

.assignee-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 10px;
    transition: background 0.2s, transform 0.2s;
    cursor: pointer;
}

.assignee-card:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

.assignee-avatar-wrapper {
    flex-shrink: 0;
}

.assignee-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.assignee-card-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.assignee-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.assignee-card-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.assignee-card-issues {
    font-size: 0.75rem;
    color: #6b7280;
}

.assignee-card-stats {
    display: flex;
    gap: 0.5rem;
}

.assignee-card-stats span {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

.open-count {
    background: #dbeafe;
    color: #2563eb;
}

.done-count {
    background: #dcfce7;
    color: #059669;
}

/* Empty States */
.jira-empty.large {
    padding: 4rem 2rem;
}

.jira-empty.large .empty-icon {
    width: 100px;
    height: 100px;
}

.jira-empty.large .empty-icon i {
    font-size: 3rem;
}

.jira-empty.compact {
    padding: 2rem;
    flex-direction: row;
    gap: 1rem;
}

.jira-error.compact {
    padding: 1rem;
    flex-direction: row;
    gap: 0.75rem;
    background: #fef2f2;
    border-radius: 8px;
    margin: 1rem;
}

.jira-btn.small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .project-header {
        flex-direction: column;
        text-align: center;
    }

    .project-actions {
        width: 100%;
        flex-direction: column;
    }

    .project-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hierarchy-item .issue-summary {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .project-stats-grid {
        grid-template-columns: 1fr;
    }
}
