/* ===== Community Events - Classic Theme ===== */

/* Sidebar panel */
#sidebar-community-event {
    font-size: 0.85em;
}

.ce-event-type {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95em;
}

/* Phase row */
.ce-phase-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.ce-phase-tag {
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: var(--ui-radius-sm, 2px);
}

.ce-phase-notice {
    color: var(--special-color);
    border: 1px solid var(--special-color);
}

.ce-phase-active {
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.ce-phase-resolving {
    color: var(--dim-color);
    border: 1px solid var(--dim-color);
}

.ce-phase-idle {
    color: var(--dim-color);
    border: 1px solid var(--dim-color);
}

#ce-timer {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    color: var(--text-color);
}

/* Level section */
.ce-level-section {
    margin-bottom: 8px;
}

.ce-level-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.85em;
}

.ce-level-row span:first-child {
    color: var(--dim-color);
}

#ce-level-value {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 1.1em;
}

/* Level pulse animation */
.ce-level-pulse {
    animation: ce-level-flash 0.6s ease-out;
}

@keyframes ce-level-flash {
    0% { text-shadow: 0 0 8px var(--accent-color); transform: scale(1.3); }
    100% { text-shadow: none; transform: scale(1); }
}

/* Progress bar (uses existing .progress-bar styles) */
#ce-progress-bar {
    height: 16px;
    margin-bottom: 4px;
}

/* Info rows */
.ce-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 0.85em;
}

.ce-info-stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 2px 0;
}

.ce-boss-section {
    margin-top: 6px;
}

/* Player section */
.ce-player-section {
    border-top: 1px solid var(--dim-color);
    padding-top: 6px;
    margin-top: 6px;
    margin-bottom: 6px;
}

.ce-role-locked-text {
    color: var(--warning-color);
    font-size: 0.8em;
    font-style: italic;
}

.ce-cap-reached {
    color: var(--special-color);
    font-weight: 600;
}

/* Cap section */
.ce-cap-section {
    margin-bottom: 4px;
}

/* Action buttons */
.ce-actions {
    margin-top: 8px;
}

.ce-btn {
    width: 100%;
    padding: 5px 8px;
    margin-bottom: 4px;
    font-size: 0.8em;
    cursor: pointer;
    border: 1px solid var(--accent-color);
    background: transparent;
    color: var(--accent-color);
    text-transform: uppercase;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}

.ce-btn:hover:not(:disabled) {
    background: var(--accent-color);
    color: var(--bg-color);
}

.ce-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ce-btn-danger {
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.ce-btn-danger:hover:not(:disabled) {
    background: var(--warning-color);
    color: var(--bg-color);
}

/* Error message */
#ce-error-msg {
    color: var(--error-color, var(--warning-color));
    font-size: 0.8em;
    margin-top: 4px;
    padding: 2px 0;
}

/* Idle section */
#ce-idle-section {
    font-size: 0.85em;
}

/* ===== Detail View ===== */

.ce-detail-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 5px;
}

#community-events-view {
    display: none;
    flex-direction: row;
    gap: 1.5rem;
    padding: 0.5rem;
    height: 100%;
    width: 100%;
}

.ce-view-layout {
    display: contents;
}

.ce-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-right: 1px solid var(--border-color);
    padding-right: 0.5rem;
    min-width: 140px;
}

.ce-tab {
    padding: var(--tab-padding);
    background: var(--tab-bg);
    border: none;
    border-left: 2px solid transparent;
    border-radius: var(--ui-radius-sm);
    color: var(--tab-color);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    text-align: left;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.ce-tab:hover {
    color: var(--text-color);
    background: var(--ui-surface-hover);
}

.ce-tab.active {
    color: var(--tab-active-color);
    border-left-color: var(--tab-active-border-color);
    background: var(--tab-active-bg);
}

.ce-dropdown-container {
    display: none;
}

.ce-dropdown {
    width: 100%;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.9em;
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.ce-dropdown:focus {
    border-color: var(--accent-color);
    outline: none;
}

.ce-tab-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

.ce-tab-panel {
    display: none;
}

.ce-tab-panel.active {
    display: block;
}

.ce-detail-columns {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    gap: 15px;
}

.ce-detail-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ce-detail-section {
    border: var(--ui-border-light);
    border-radius: var(--ui-radius-md, 0);
    padding: var(--card-padding, 10px);
    background: var(--surface-secondary, transparent);
}

.ce-stats-table {
    width: 100%;
    border-collapse: collapse;
}

.ce-stats-table td {
    padding: 3px 0;
    font-size: 0.9em;
}

.ce-stats-table td:first-child {
    width: 40%;
    color: var(--dim-color);
}

.ce-section-subheader {
    color: var(--accent-color);
    font-size: 0.9em;
    margin: 10px 0 6px;
    padding-top: 8px;
    border-top: 1px solid var(--dim-color);
}

.ce-ranking-table td:first-child {
    width: auto;
}

#ce-resolution-content {
    width: 100%;
}

#ce-resolution-content .ce-resolution-layout {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

#ce-resolution-content .ce-resolution-left-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

#ce-resolution-content .ce-resolution-panel {
    min-width: 0;
    border: var(--ui-border-light);
    border-radius: var(--ui-radius-md, 0);
    padding: var(--card-padding, 10px);
    background: var(--surface-secondary, transparent);
}

#ce-resolution-content .ce-resolution-panel-title {
    color: var(--accent-color);
    font-size: 0.9em;
    margin: 0 0 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

#ce-resolution-content .ce-results-table,
#ce-resolution-content .ce-ranking-table {
    width: 100%;
}

.ce-results-table td {
    padding: 6px 10px;
}

.ce-results-table td:first-child {
    padding-right: 18px;
}

.ce-results-table td:last-child {
    text-align: right;
    padding-left: 18px;
}

.ce-ranking-table td {
    padding: 6px 10px;
}

.ce-ranking-sort-cell {
    text-align: right;
}

.ce-ranking-sort-btn {
    background: none;
    border: none;
    color: var(--dim-color);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    padding: 0;
}

.ce-ranking-sort-btn:hover {
    color: var(--text-color);
}

.ce-ranking-sort-btn:focus-visible {
    outline: 1px solid var(--accent-color);
    outline-offset: 2px;
}

.ce-ranking-value-cell {
    text-align: right;
}

.ce-ranking-current-player td {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-color);
    font-weight: 700;
}

.ce-ranking-current-player .ce-ranking-value-cell {
    color: var(--accent-color);
}

.ce-combat-log {
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ce-combat-narrative {
    font-size: 0.9em;
    color: var(--text-color);
    line-height: 1.45;
    padding: 4px 0;
    border-bottom: 1px solid var(--dim-color);
}

.ce-combat-narrative:last-child {
    border-bottom: none;
}

.ce-knockout-line {
    font-size: 0.85em;
    color: var(--warning-color);
    font-style: italic;
    margin-top: 2px;
}

.ce-participant-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ce-participant-summary {
    font-size: 0.9em;
}

.ce-participant-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.ce-group-card {
    border: var(--ui-border-light);
    border-radius: var(--ui-radius-md, 0);
    background: var(--surface-secondary, transparent);
    padding: 12px;
}

.ce-group-card.ce-group-targeted {
    border-color: var(--warning-color);
    box-shadow: 0 0 0 1px rgba(var(--warning-color-rgb, 255, 180, 0), 0.25);
}

.ce-group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.ce-group-title {
    font-weight: 700;
    color: var(--accent-color);
}

.ce-group-badge {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--warning-color);
}

.ce-group-meta {
    font-size: 0.8em;
    color: var(--dim-color);
}

.ce-group-members {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ce-participant-card {
    border-top: 1px solid var(--dim-color);
    padding-top: 10px;
}

.ce-participant-card:first-child {
    border-top: none;
    padding-top: 0;
}

.ce-participant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.ce-participant-name {
    font-weight: 600;
}

.ce-participant-status {
    font-size: 0.8em;
    color: var(--dim-color);
}

.ce-participant-status.ce-status-online {
    color: var(--success-color);
}

.ce-participant-status.ce-status-offline {
    color: var(--warning-color);
}

.ce-participant-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.8em;
    color: var(--dim-color);
    margin-bottom: 8px;
}

.ce-hp-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ce-hp-label-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8em;
}

.ce-hp-label-row .dim {
    color: var(--dim-color);
}

.ce-mini-progress {
    position: relative;
    height: 12px;
    border: 1px solid var(--dim-color);
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.ce-mini-progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.25s ease;
}

.ce-mini-progress-fill.ce-hp-low {
    background: var(--warning-color);
}

.ce-mini-progress-fill.ce-hp-empty {
    background: var(--error-color, var(--warning-color));
}

.ce-hp-block.ce-hp-inactive .ce-mini-progress-fill {
    background: var(--dim-color);
}

.ce-live-ranking-table {
    width: 100%;
}

.ce-live-ranking-table td {
    padding: 6px 10px;
}

.ce-live-ranking-table td:first-child {
    width: auto;
}

.ce-ranking-player-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ce-ranking-player-subline {
    font-size: 0.78em;
    color: var(--dim-color);
}

@media (max-width: 980px) {
    #community-events-view {
        flex-direction: column;
        gap: 0;
    }

    .ce-tabs {
        display: none !important;
    }

    .ce-dropdown-container {
        display: block !important;
        margin-bottom: 1rem;
    }

    .ce-detail-columns {
        grid-template-columns: 1fr;
    }

    #ce-resolution-content .ce-resolution-layout {
        grid-template-columns: 1fr;
    }
}

/* ===== Active Buffs Panel ===== */

.buff-row {
    padding: 6px 0;
    border-bottom: 1px solid var(--dim-color);
}

.buff-row:last-child {
    border-bottom: none;
}

.buff-name {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9em;
}

.buff-effects {
    font-size: 0.8em;
    margin: 2px 0;
}

.buff-timer {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8em;
    color: var(--text-color);
}

/* Overflow tier badges */
.ce-tier-T1_Bronze { color: #cd7f32; }
.ce-tier-T2_Silver { color: #c0c0c0; }
.ce-tier-T3_Gold { color: #ffd700; }
.ce-tier-T4_Obsidian { color: #9966cc; }

/* ===== Detail View - Card-Based Layout ===== */

/* Event header card */
.ce-event-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ce-icon {
    font-size: 1.5em;
    line-height: 1;
    flex-shrink: 0;
}

.ce-event-title {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 1.05em;
    flex: 1;
    min-width: 0;
}

.ce-header-timer {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 1.3em;
    color: var(--text-color);
    white-space: nowrap;
}

/* Stat grid - similar to profile stat layout */
.ce-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.ce-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0.4rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.ce-stat-label {
    font-size: 0.72em;
    color: var(--text-color);
    opacity: 0.7;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
    text-align: center;
    letter-spacing: 0.02em;
}

.ce-stat-value {
    font-size: 1.4em;
    font-weight: 600;
    color: var(--accent-color);
}

.ce-stat-value-special {
    color: var(--special-color);
}

.ce-stat-item-wide {
    grid-column: span 3;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 0.4rem;
}

.ce-stat-item-wide .ce-stat-label {
    margin-bottom: 0;
}

.ce-stat-item-wide .ce-stat-value {
    font-size: 1.1em;
}

/* Buff grid for rogue events */
.ce-buff-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    margin-top: 6px;
}

.ce-buff-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.25rem;
}

.ce-buff-label {
    font-size: 0.7em;
    color: var(--dim-color);
    text-transform: uppercase;
    margin-bottom: 0.15rem;
    text-align: center;
}

.ce-buff-value {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--special-color);
}

/* Idle card */
.ce-idle-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
    border: var(--ui-border-light);
    border-radius: var(--ui-radius-md, 0);
    background: var(--surface-secondary, transparent);
}

.ce-idle-icon {
    font-size: 2em;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.ce-idle-message {
    color: var(--dim-color);
    font-size: 0.95em;
    margin-bottom: 0.5rem;
}

.ce-idle-countdown {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-color);
}

/* Subheader for card sections */
.ce-card-subheader {
    color: var(--accent-color);
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

/* Boss HP bar color transitions */
.ce-detail-boss-hp-fill-green {
    background: var(--success-color);
}

.ce-detail-boss-hp-fill-yellow {
    background: var(--warning-color);
}

.ce-detail-boss-hp-fill-red {
    background: var(--error-color, var(--warning-color));
}

/* Resolution panel icons (inline) */
.ce-panel-icon {
    margin-right: 4px;
}

/* Accent value highlights in resolution */
.ce-value-accent {
    color: var(--accent-color);
    font-weight: 600;
}

.ce-value-special {
    color: var(--special-color);
    font-weight: 600;
}

/* Contribution stat grid */
.ce-contrib-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.ce-contrib-stat-grid .ce-stat-item {
    padding: 0.5rem 0.3rem;
}

.ce-contrib-stat-grid .ce-stat-value {
    font-size: 1.15em;
}

.ce-contrib-stat-grid .ce-stat-item-wide {
    grid-column: span 2;
}

/* Override contribution role icon + label row */
.ce-contrib-role-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.ce-contrib-role-label {
    font-size: 0.85em;
    color: var(--dim-color);
}

.ce-contrib-role-value {
    font-weight: 600;
    color: var(--accent-color);
}

/* Forced role inline */
.ce-contrib-forced-role {
    font-size: 0.8em;
    color: var(--warning-color);
    font-style: italic;
    margin-bottom: 6px;
}

/* Responsive for stat grids */
@media (max-width: 980px) {
    .ce-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ce-stat-item-wide {
        grid-column: span 2;
    }

    .ce-contrib-stat-grid .ce-stat-item-wide {
        grid-column: span 2;
    }

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

@media (max-width: 450px) {
    .ce-stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ce-buff-grid {
        grid-template-columns: 1fr 1fr;
    }
}
