/**
 * CSP Consultation Card Styles - v4.0 (Major Update)
 * Style dla karty konsultacji w feedzie
 */

.csp-cons-card {
    margin-top: 20px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    font-family: 'Inter', -apple-system, sans-serif;
}

/* =============================================
   HEADER
   ============================================= */
.csp-cons-card-header {
    background: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.csp-cons-header-left {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.csp-cons-header-info {
    flex: 1;
    min-width: 0;
}

.csp-cons-header-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.csp-cons-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Compact icon button — base style */
.csp-cons-icon-btn,
.csp-cons-doc-icon-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%) !important;
    color: #8b5cf6 !important;
    font-size: 16px !important;
    border: none !important;
    padding: 0 !important;
    margin: 0;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    line-height: 1 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.csp-cons-icon-btn:hover,
.csp-cons-doc-icon-btn:hover {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%) !important;
    color: #7c3aed !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2) !important;
}
.csp-cons-icon-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}
.csp-cons-icon-btn i,
.csp-cons-doc-icon-btn i {
    font-size: 16px !important;
    color: inherit !important;
    line-height: 1 !important;
}

/* Danger variant (delete, end voting) */
.csp-cons-icon-btn.csp-cons-icon-btn--danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
    color: #dc2626 !important;
}
.csp-cons-icon-btn.csp-cons-icon-btn--danger:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
    color: #b91c1c !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2) !important;
}
.csp-cons-icon-btn.csp-cons-icon-btn--danger i {
    color: inherit !important;
}

/* Subtle variant (copy, inline actions) */
.csp-cons-icon-btn.csp-cons-icon-btn--subtle {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
    font-size: 14px !important;
}
.csp-cons-icon-btn.csp-cons-icon-btn--subtle:hover {
    background: #f8fafc !important;
    color: #a78bfa !important;
    border-color: #c4b5fd !important;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.15) !important;
}
.csp-cons-icon-btn.csp-cons-icon-btn--subtle i {
    font-size: 14px !important;
    color: inherit !important;
}

.csp-cons-card-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.csp-cons-card-icon i {
    color: #a78bfa;
    font-size: 20px;
}

/* Status label */
.csp-cons-status-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.csp-cons-status-label.live { color: #a78bfa; }
.csp-cons-status-label.waiting { color: #f59e0b; }
.csp-cons-status-label.ended { color: #64748b; }

/* Badges */
.csp-cons-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.csp-cons-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.csp-cons-badge i { font-size: 10px; }
.csp-cons-badge.badge-secret {
    background: #1f2937;
    color: #fff;
    border: 1px solid #374151;
}
.csp-cons-badge.badge-public {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}
.csp-cons-badge.badge-open {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.csp-cons-badge.badge-closed {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

/* Title */
.csp-cons-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.csp-cons-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}
.csp-cons-header-description {
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
    margin: 4px 0 0 0;
}

/* Timer Badge */
.csp-cons-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #a78bfa;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 8px rgba(167, 139, 250, 0.3);
}
.csp-cons-timer-badge i { font-size: 12px; }
.csp-cons-timer-badge.waiting {
    background: #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}
.csp-cons-timer-badge.ended {
    background: #64748b;
    box-shadow: none;
}
.csp-cons-timer-label { text-transform: uppercase; }

/* Progress Bar */
.csp-cons-progress-bar {
    height: 3px;
    background: #f3e8ff;
    width: 100%;
}
.csp-cons-progress-fill {
    height: 100%;
    background: #a78bfa;
    transition: width 1s ease;
}
.csp-cons-progress-fill.waiting { background: #f59e0b; }
.csp-cons-progress-fill.ended { background: #94a3b8; opacity: 0.5; }

/* Toolbar */
.csp-cons-toolbar {
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
}
.csp-cons-doc-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Body */
.csp-cons-body {
    padding: 20px;
}

/* Rules Document Link */
.csp-cons-rules-doc-link {
    margin-bottom: 16px;
}
.csp-cons-rules-doc-link a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    color: #4f46e5;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.csp-cons-rules-doc-link a:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-color: #a5b4fc;
}
.csp-cons-rules-doc-link a i:first-child {
    font-size: 18px;
    color: #6366f1;
}
.csp-cons-rules-doc-link a span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hero Image */
.csp-cons-hero-image {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.csp-cons-hero-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Context Link */
.csp-cons-context-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 16px;
    text-decoration: none;
    transition: all 0.2s;
}
.csp-cons-context-link:hover {
    border-color: #c4b5fd;
    background: #faf5ff;
}
.csp-cons-context-link img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
}
.csp-cons-context-info { flex: 1; }
.csp-cons-context-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.csp-cons-context-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-top: 2px;
}
.csp-cons-context-link > i {
    color: #94a3b8;
    font-size: 14px;
}

/* Dates */
.csp-cons-dates {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 20px;
}
.csp-cons-dates i { margin-right: 4px; }
.csp-cons-date-end.indefinite {
    color: #a78bfa;
    font-weight: 600;
}

.csp-cons-question-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.csp-cons-question-block:last-child { margin-bottom: 0; }

.csp-cons-question-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.csp-cons-question-title .required { color: #ef4444; }

/* Single choice options */
.csp-cons-option-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    font-size: 14px;
    color: #334155;
    position: relative; /* relative for input hiding */
}
.csp-cons-option-btn:hover { border-color: #c4b5fd; background: #faf5ff; }

/* FIX: Visually hide inputs */
.csp-cons-option-btn input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    z-index: -1;
}

.csp-cons-option-btn.selected { border-color: #4f46e5; background: #faf5ff; }

/* ZPW scheme - before selection (light colors) */
.csp-cons-option-btn.scheme-zpw-za { background: #f0fdf4; border-color: #bbf7d0; }
.csp-cons-option-btn.scheme-zpw-przeciw { background: #fef2f2; border-color: #fecaca; }
.csp-cons-option-btn.scheme-zpw-wstrzymuje { background: #fefce8; border-color: #fde68a; }

/* ZPW scheme - after selection (intense colors) */
.csp-cons-option-btn.scheme-zpw-za.selected { border-color: #22c55e; background: #22c55e; color: #fff; }
.csp-cons-option-btn.scheme-zpw-przeciw.selected { border-color: #ef4444; background: #ef4444; color: #fff; }
.csp-cons-option-btn.scheme-zpw-wstrzymuje.selected { border-color: #f59e0b; background: #f59e0b; color: #fff; }

/* ZPW scheme - radio styling for selected state */
.csp-cons-option-btn.scheme-zpw-za.selected .csp-custom-radio { border-color: #fff; background: #fff; }
.csp-cons-option-btn.scheme-zpw-za.selected .csp-custom-radio::after { background: #22c55e; }
.csp-cons-option-btn.scheme-zpw-przeciw.selected .csp-custom-radio { border-color: #fff; background: #fff; }
.csp-cons-option-btn.scheme-zpw-przeciw.selected .csp-custom-radio::after { background: #ef4444; }
.csp-cons-option-btn.scheme-zpw-wstrzymuje.selected .csp-custom-radio { border-color: #fff; background: #fff; }
.csp-cons-option-btn.scheme-zpw-wstrzymuje.selected .csp-custom-radio::after { background: #f59e0b; }

/* ZPW tiles voting layout - force 3 columns for ZPW voting */
.csp-zpw-tiles-voting {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px;
}
.csp-zpw-tiles-voting .csp-cons-option-btn {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
    min-height: 80px;
    justify-content: center;
}

/* Multi choice */
.csp-cons-checkbox-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    font-size: 14px;
    color: #334155;
    gap: 10px;
    position: relative;
}
.csp-cons-checkbox-btn:hover { border-color: #c4b5fd; background: #faf5ff; }

/* FIX: Custom checkboxes need different handling or visually hidden native ones */
.csp-cons-checkbox-btn input[type="checkbox"] {
    /* Keep width/height if we want to show native checkbox, or hide if we want custom */
    width: 18px;
    height: 18px;
    accent-color: #a78bfa;
    cursor: pointer;
}
.csp-cons-checkbox-btn.selected { border-color: #a78bfa; background: #faf5ff; }

/* Scale slider */
.csp-cons-scale-container { padding: 10px 0; }
.csp-cons-scale-labels { display: flex; justify-content: space-between; font-size: 11px; color: #64748b; margin-bottom: 8px; }
.csp-cons-scale-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: linear-gradient(to right, #ef4444 0%, #f59e0b 25%, #eab308 50%, #84cc16 75%, #10b981 100%);
    border-radius: 4px;
    outline: none;
}
.csp-cons-scale-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #fff;
    border: 3px solid #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.csp-cons-scale-value {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #8b5cf6;
    margin-top: 10px;
}

/* Text input */
.csp-cons-text-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}
.csp-cons-text-input:focus { border-color: #8b5cf6; outline: none; box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1); }

/* Submit button */
.csp-cons-submit-btn {
    width: auto;
    min-width: 200px;
    padding: 16px 40px;
    background: #A78BFA;
    color: white;
    font-weight: 600;
    font-size: 15px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.35);
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 24px auto 0;
}
.csp-cons-submit-btn:hover {
    background: #9061F9;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(167, 139, 250, 0.4);
}
.csp-cons-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.csp-cons-submit-btn i {
    font-size: 16px;
}

/* Hash ticket */
.csp-cons-hash-ticket { background: #f0fdf4; border: 2px dashed #4ade80; border-radius: 12px; padding: 24px; text-align: center; }
.csp-cons-hash-ticket code { word-break: break-all; overflow-wrap: break-word; }

/* Vote form centering */
.csp-cons-vote-form { text-align: center; }

/* =============================================
   RESULTS DASHBOARD
   ============================================= */
.csp-cons-results-locked {
    text-align: center;
    padding: 40px;
    background: #f8fafc;
    border-radius: 12px;
}
.csp-cons-results-locked i { font-size: 40px; color: #a78bfa; display: block; margin-bottom: 12px; }
.csp-cons-results-locked h3 { margin: 0 0 8px; font-size: 16px; color: #1e293b; }
.csp-cons-results-locked p { margin: 0; color: #64748b; font-size: 13px; }

.csp-cons-results-dashboard {
    background: #f5f3ff;
    border: 1px solid #ede9fe;
    border-radius: 16px;
    padding: 24px;
}

/* Results Header */
.csp-cons-results-header {
    text-align: center;
    margin-bottom: 24px;
}
.csp-cons-results-icon {
    width: 64px;
    height: 64px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 2px 8px rgba(159, 85, 255, 0.1);
}
.csp-cons-results-icon i { font-size: 28px; color: #a78bfa; }
.csp-cons-results-title {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 4px;
    letter-spacing: 0.5px;
}
.csp-cons-results-subtitle {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

/* Stats Grid */
.csp-cons-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.csp-cons-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.csp-cons-stat-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.csp-cons-stat-value {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
}
.csp-cons-stat-card.invalid { border-bottom: 3px solid #f87171; }
.csp-cons-stat-card.invalid .csp-cons-stat-label { color: #f87171; }
.csp-cons-stat-card.invalid .csp-cons-stat-value { color: #dc2626; }
.csp-cons-stat-card.valid { border-bottom: 3px solid #4ade80; }
.csp-cons-stat-card.valid .csp-cons-stat-label { color: #4ade80; }
.csp-cons-stat-card.valid .csp-cons-stat-value { color: #16a34a; }

/* Turnout Block */
.csp-cons-turnout-block {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #ede9fe;
}
.csp-cons-turnout-block h4 {
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.csp-cons-turnout-block h4 i { color: #a78bfa; }
.csp-cons-turnout-bar {
    height: 10px;
    background: #f1f5f9;
    border-radius: 5px;
    overflow: visible;
    position: relative;
    margin-bottom: 8px;
}
.csp-cons-turnout-fill {
    height: 100%;
    background: #a78bfa;
    border-radius: 5px;
    transition: width 0.5s;
}
.csp-cons-quorum-marker {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: #ef4444;
}
.csp-cons-turnout-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 12px;
}
.csp-cons-quorum-label { color: #ef4444; font-weight: 600; }
.csp-cons-quorum-warning {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.csp-cons-quorum-ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Result Sections */
.csp-cons-results-questions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.csp-cons-result-section {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 16px;
}
.csp-cons-result-section-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 16px;
    line-height: 1.4;
}
.csp-cons-result-section-header i { color: #a78bfa; flex-shrink: 0; margin-top: 1px; }

/* ZPW Tiles */
.csp-cons-zpw-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.csp-cons-zpw-tile {
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 90px;
}
.csp-cons-zpw-tile.za { background: #f0fdf4; border: 1px solid #bbf7d0; }
.csp-cons-zpw-tile.przeciw { background: #fef2f2; border: 1px solid #fecaca; }
.csp-cons-zpw-tile.wstrzymuje { background: #fffbeb; border: 1px solid #fde68a; }
.csp-cons-zpw-pct {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 4px;
}
.csp-cons-zpw-tile.za .csp-cons-zpw-pct { color: #16a34a; }
.csp-cons-zpw-tile.przeciw .csp-cons-zpw-pct { color: #dc2626; }
.csp-cons-zpw-tile.wstrzymuje .csp-cons-zpw-pct { color: #d97706; }
.csp-cons-zpw-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.csp-cons-zpw-tile.za .csp-cons-zpw-label { color: #16a34a; }
.csp-cons-zpw-tile.przeciw .csp-cons-zpw-label { color: #dc2626; }
.csp-cons-zpw-tile.wstrzymuje .csp-cons-zpw-label { color: #d97706; }
.csp-cons-zpw-count {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
}

/* Standard Result Bars */
.csp-cons-result-bars { display: flex; flex-direction: column; gap: 12px; }
.csp-cons-result-bar-row {}
.csp-cons-result-bar-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}
.csp-cons-result-bar-label {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}
.csp-cons-result-bar-stats {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}
.csp-cons-result-bar {
    height: 10px;
    background: #f1f5f9;
    border-radius: 5px;
    overflow: hidden;
}
.csp-cons-result-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.8s ease;
}
.csp-cons-result-bar-fill.default { background: #a78bfa; }
.csp-cons-result-bar-fill.za { background: #22c55e; }
.csp-cons-result-bar-fill.przeciw { background: #ef4444; }
.csp-cons-result-bar-fill.wstrzymuje { background: #f59e0b; }

/* Rating Result */
.csp-cons-rating-result {
    text-align: center;
    padding: 20px 0;
}
.csp-cons-rating-avg {
    font-size: 48px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 8px;
}
.csp-cons-rating-stars-display {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.csp-cons-rating-stars-display i {
    font-size: 16px;
    color: #cbd5e1;
}
.csp-cons-rating-stars-display i.active {
    color: #fbbf24;
}
.csp-cons-rating-meta {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Text Result */
.csp-cons-text-result-box {
    text-align: center;
    padding: 20px;
}
.csp-cons-text-count {
    font-size: 36px;
    font-weight: 800;
    color: #1e293b;
}
.csp-cons-text-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.csp-cons-text-note {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    margin: 0;
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
}

/* Results Footer */
.csp-cons-results-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #ede9fe;
}
.csp-cons-download-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: #1e293b;
    color: #fff;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.csp-cons-download-pdf-btn:hover {
    background: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.csp-cons-download-pdf-btn i { font-size: 18px; }
.csp-cons-results-note {
    font-size: 10px;
    color: #94a3b8;
    margin: 12px 0 0;
}

/* Admin delete — uses .csp-cons-icon-btn.csp-cons-icon-btn--danger */

/* Tile layout */
.csp-cons-options-container.csp-cons-layout-tile {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.csp-cons-layout-tile .csp-cons-option-btn,
.csp-cons-layout-tile .csp-cons-checkbox-btn {
    flex-direction: column;
    padding: 0;
    min-height: 180px;
    margin-bottom: 0;
}
.csp-cons-layout-tile .csp-cons-option-btn.has-media,
.csp-cons-layout-tile .csp-cons-checkbox-btn.has-media {
    min-height: 220px;
}

/* Option media */
.csp-cons-option-media {
    width: 100%;
    height: 120px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}
.csp-cons-option-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Option content */
.csp-cons-option-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
}
.csp-cons-layout-tile .csp-cons-option-content {
    justify-content: center;
    text-align: center;
}

/* FIX: Ensure tile input is also hidden/handled */
.csp-cons-layout-tile .csp-cons-option-content input {
    position: absolute;
    opacity: 0;
    z-index: -1;
}

/* Option thumbnail (linear layout) */
.csp-cons-option-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    margin-left: auto;
}

/* Option link */
.csp-cons-option-link {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    border-radius: 6px;
    color: #4F46E5;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.csp-cons-option-btn:hover .csp-cons-option-link,
.csp-cons-checkbox-btn:hover .csp-cons-option-link {
    opacity: 1;
}

/* Make option buttons relative for link positioning */
.csp-cons-option-btn,
.csp-cons-checkbox-btn {
    position: relative;
}

/* =============================================
   VIEW TOGGLE (Simple/List/Grid)
   ============================================= */
.csp-cons-question-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}
.csp-cons-view-toggle {
    display: flex;
    gap: 4px;
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    flex-shrink: 0;
}
.csp-cons-view-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent !important;
    border-radius: 0;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}
.csp-cons-view-btn:hover {
    color: #A78BFA;
    background: transparent !important;
}
.csp-cons-view-btn.active {
    background: transparent !important;
    color: #A78BFA;
}
.csp-cons-view-btn i {
    font-size: 16px;
    color: inherit;
}

/* View modes */
.csp-cons-options-container[data-current-view="list"] .csp-cons-option-btn,
.csp-cons-options-container[data-current-view="list"] .csp-cons-checkbox-btn {
    padding: 8px;
    gap: 12px;
}
.csp-cons-options-container[data-current-view="list"] .csp-cons-option-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    margin-left: 0;
    order: -1;
}
.csp-cons-options-container[data-current-view="grid"] {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.csp-cons-options-container[data-current-view="grid"] .csp-cons-option-btn,
.csp-cons-options-container[data-current-view="grid"] .csp-cons-checkbox-btn {
    flex-direction: column;
    padding: 0;
    margin-bottom: 0;
    min-height: 160px;
}
.csp-cons-options-container[data-current-view="grid"] .csp-cons-option-media {
    display: block;
}
.csp-cons-options-container[data-current-view="simple"] .csp-cons-option-media,
.csp-cons-options-container[data-current-view="simple"] .csp-cons-option-thumb {
    display: none;
}

/* =============================================
   RATING (Stars 1-10)
   ============================================= */
.csp-cons-rating-container {
    text-align: center;
    padding: 20px 10px;
}
.csp-cons-rating-stars {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.csp-cons-star-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s;
    padding: 4px;
    line-height: 1;
}
.csp-cons-star-btn:hover { transform: scale(1.2); }
.csp-cons-star-btn i {
    font-size: 22px;
    color: #cbd5e1;
    transition: color 0.15s, transform 0.15s;
}
.csp-cons-star-btn.active i,
.csp-cons-star-btn.hover i {
    color: #fbbf24;
}
.csp-cons-star-btn.active i {
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}
.csp-cons-rating-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 8px;
}
.csp-cons-rating-value {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #f59e0b;
    min-height: 20px;
}

/* Scale as stars (1-10 yellow stars) */
.csp-cons-scale-as-stars {
    text-align: center;
    padding: 15px 5px;
}
.csp-cons-scale-as-stars .csp-cons-rating-stars {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.csp-cons-scale-as-stars .csp-cons-star-btn {
    padding: 3px;
}
.csp-cons-scale-as-stars .csp-cons-star-btn i {
    font-size: 20px;
    color: #cbd5e1;
    transition: color 0.15s, transform 0.15s;
}
.csp-cons-scale-as-stars .csp-cons-star-btn.active i,
.csp-cons-scale-as-stars .csp-cons-star-btn.hover i {
    color: #fbbf24;
}
.csp-cons-scale-as-stars .csp-cons-star-btn.active i {
    text-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}

/* =============================================
   FOOTER - Identity Block & QR
   ============================================= */
.csp-cons-footer {
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    padding: 20px;
}
.csp-cons-identity-block {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
.csp-cons-identity-info {
    flex: 1;
    min-width: 0;
}
.csp-cons-identity-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.csp-cons-identity-label i { font-size: 14px; }
.csp-cons-identity-id {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f4ff;
    border: 1px solid #e0e7ff;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.csp-cons-hash-symbol {
    color: #818cf8;
    font-weight: 600;
    opacity: 0.6;
}
.csp-cons-voting-id {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #4f46e5;
}
/* Copy button — uses .csp-cons-icon-btn.csp-cons-icon-btn--subtle + .csp-cons-copy-btn for JS */
.csp-cons-identity-desc {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
    max-width: 320px;
}

/* QR Code */
.csp-cons-qr-wrapper { flex-shrink: 0; }
.csp-cons-qr-btn {
    display: block;
    background: transparent !important;
    border: none !important;
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
}
.csp-cons-qr-btn:hover {
    transform: scale(1.05);
    box-shadow: none;
}
.csp-cons-qr-btn img {
    width: 120px !important;
    height: 120px !important;
    display: block;
    border-radius: 8px;
}
/* QR Code Styling containers */
.csp-qr-container {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.csp-qr-container svg {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
.csp-qr-container-large {
    width: 260px;
    height: 260px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.csp-qr-container-large svg {
    display: block;
    width: 260px !important;
    height: 260px !important;
}
.csp-cons-qr-placeholder {
    width: 120px;
    height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.csp-cons-qr-placeholder > i {
    font-size: 100px;
    color: #A78BFA;
}
.csp-cons-qr-avatar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    border-radius: 4px;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
    .csp-cons-card-header {
        flex-direction: column;
        align-items: stretch;
    }
    .csp-cons-header-right {
        justify-content: flex-end;
    }
    .csp-cons-badges {
        margin-top: 4px;
    }
    .csp-cons-identity-block {
        flex-direction: column;
        align-items: stretch;
    }
    .csp-cons-qr-wrapper {
        display: flex;
        justify-content: center;
    }
    .csp-cons-options-container[data-current-view="grid"] {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .csp-cons-options-container.csp-cons-layout-tile {
        grid-template-columns: 1fr 1fr;
    }
    .csp-cons-star-btn {
        padding: 2px;
    }
    .csp-cons-star-btn i {
        font-size: 16px;
    }
    .csp-cons-scale-as-stars .csp-cons-star-btn i {
        font-size: 14px;
    }
}
/* =============================================
   OPTIONS LAYOUT (Redesign)
   ============================================= */

/* Wspólne dla opcji */
.csp-cons-option-btn,
.csp-cons-checkbox-btn {
    display: flex;
    background: #fff;
    border: 1px solid #e2e8f0; /* Subtelniejsza ramka */
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 60px;
}

/* Hover & Selected States */
.csp-cons-option-btn:hover,
.csp-cons-checkbox-btn:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.csp-cons-option-btn.selected,
.csp-cons-checkbox-btn.selected {
    border-color: #1e293b; /* Ciemna ramka jak na screenie */
    background: #fff;
    box-shadow: 0 0 0 1px #1e293b;
}

/* Ukrycie natywnych inputów */
.csp-cons-option-btn input,
.csp-cons-checkbox-btn input {
    position: absolute;
    opacity: 0;
    z-index: -1;
}

/* --- TILE LAYOUT (GRID) --- */
.csp-cons-options-container.csp-cons-layout-tile {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* Responsywne kafelki */
    gap: 16px;
}

.csp-cons-layout-tile .csp-cons-option-btn,
.csp-cons-layout-tile .csp-cons-checkbox-btn {
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
    border-radius: 16px;
}

/* Media w kafelku - Pełna szerokość na górze */
.csp-cons-layout-tile .csp-cons-option-media {
    width: 100%;
    height: 180px; /* Wysokość obrazka */
    position: relative;
    background: #f1f5f9;
}

.csp-cons-layout-tile .csp-cons-option-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.csp-cons-layout-tile .csp-cons-option-btn:hover img {
    transform: scale(1.05);
}

.csp-media-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    color: #1e293b;
}
.csp-cons-layout-tile .csp-cons-option-btn:hover .csp-media-overlay {
    opacity: 1;
}

/* Content w kafelku */
.csp-cons-layout-tile .csp-cons-option-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.csp-cons-layout-tile .csp-text-wrapper {
    margin-bottom: 12px;
    flex: 1;
}

.csp-cons-layout-tile .csp-opt-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    display: block;
    margin-bottom: 4px;
}

/* Przycisk "Wybierz" w kafelku */
.csp-cons-layout-tile .csp-input-wrapper {
    margin-top: auto;
    width: 100%;
}

.csp-cons-layout-tile .csp-custom-radio {
    display: block;
    width: 100%;
    padding: 10px 0;
    text-align: center;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s;
}
.csp-cons-layout-tile .csp-custom-radio::after {
    content: 'Wybierz';
}

.csp-cons-layout-tile .selected .csp-custom-radio {
    background: #a78bfa;
    color: #fff;
}
.csp-cons-layout-tile .selected .csp-custom-radio::after {
    content: 'Wybrano';
}


/* --- LINEAR LAYOUT (LIST) --- */
.csp-cons-options-container:not(.csp-cons-layout-tile) .csp-cons-option-btn,
.csp-cons-options-container:not(.csp-cons-layout-tile) .csp-cons-checkbox-btn {
    align-items: stretch; /* Żeby obrazek wypełniał wysokość */
    padding: 0;
}

/* Obrazek po lewej stronie */
.csp-cons-options-container:not(.csp-cons-layout-tile) .csp-cons-option-media {
    width: 100px; /* Stała szerokość */
    flex-shrink: 0;
    position: relative;
    background: #f1f5f9;
    display: none; /* Domyślnie ukryty, pokażemy jeśli jest has-media */
}

.csp-cons-option-btn.has-media .csp-cons-option-media,
.csp-cons-checkbox-btn.has-media .csp-cons-option-media {
    display: block;
}

.csp-cons-options-container:not(.csp-cons-layout-tile) .csp-cons-option-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Content w liście */
.csp-cons-options-container:not(.csp-cons-layout-tile) .csp-cons-option-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 16px;
}

.csp-cons-options-container:not(.csp-cons-layout-tile) .csp-input-wrapper {
    flex-shrink: 0;
}

/* Custom Radio Circle (dla listy) */
.csp-cons-options-container:not(.csp-cons-layout-tile) .csp-custom-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
}

.csp-cons-option-btn.selected .csp-cons-options-container:not(.csp-cons-layout-tile) .csp-custom-radio {
    border-color: #4f46e5;
    border-width: 6px;
}

/* Radio button fill when selected */
.csp-cons-option-btn.selected .csp-custom-radio,
.csp-cons-checkbox-btn.selected .csp-custom-radio {
    border-color: #4f46e5;
    background: #4f46e5;
}
.csp-cons-option-btn.selected .csp-custom-radio::after,
.csp-cons-checkbox-btn.selected .csp-custom-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

/* Tytuł i Link */
.csp-text-wrapper {
    flex: 1;
}

.csp-opt-title {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    line-height: 1.4;
    display: block;
}

.csp-cons-option-btn.selected .csp-opt-title {
    font-weight: 600;
    color: #0f172a;
}

.csp-cons-option-source-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    text-decoration: none;
    background: #f8fafc;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #f1f5f9;
}
.csp-cons-option-source-link:hover {
    color: #4f46e5;
    background: #eef2ff;
}

/* --- MOBILE ADJUSTMENTS --- */
@media (max-width: 640px) {
    .csp-cons-options-container.csp-cons-layout-tile {
        grid-template-columns: 1fr; /* Jeden kafelek na wiersz */
    }

    /* Na mobile lista też może wyglądać lepiej z mniejszym obrazkiem */
    .csp-cons-options-container:not(.csp-cons-layout-tile) .csp-cons-option-media {
        width: 80px;
    }
}
.csp-cons-options-container[data-current-view="grid"] .csp-cons-option-media{
	width: 100%;
	height: 200px;
}
.csp-cons-options-container[data-current-view="simple"] .csp-cons-option-media{
	display: none;
}

/* =============================================
   QR CODE MODAL - Fullscreen
   ============================================ */
.csp-cons-qr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    justify-content: center;
    align-items: center;
}
.csp-cons-qr-modal.visible {
    display: flex;
}
.csp-cons-qr-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.csp-cons-qr-modal-content {
    position: relative;
    background: white;
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: csp-qr-modal-appear 0.3s ease-out;
}
@keyframes csp-qr-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.csp-cons-qr-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.csp-cons-qr-modal-close:hover {
    background: #e2e8f0;
}
.csp-cons-qr-modal-close i {
    font-size: 18px;
    color: #64748b;
}
.csp-cons-qr-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
}
.csp-cons-qr-modal-code {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #faf5ff;
    border-radius: 20px;
    margin-bottom: 24px;
}
.csp-cons-qr-modal-code img {
    display: block;
    width: 280px;
    height: 280px;
}
.csp-cons-qr-modal-link {
    margin-bottom: 16px;
}
.csp-cons-qr-modal-link span {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
}
.csp-cons-qr-modal-link a {
    font-size: 14px;
    color: #a78bfa;
    word-break: break-all;
    text-decoration: none;
}
.csp-cons-qr-modal-link a:hover {
    text-decoration: underline;
}
.csp-cons-qr-modal-id {
    font-size: 13px;
    color: #64748b;
    padding: 12px 20px;
    background: #f8fafc;
    border-radius: 10px;
    display: inline-block;
}
.csp-cons-qr-modal-id strong {
    color: #1e293b;
    font-family: monospace;
}

@media (max-width: 480px) {
    .csp-cons-qr-modal-content {
        padding: 24px;
    }
    .csp-cons-qr-modal-code img,
    .csp-qr-container-large {
        width: 220px;
        height: 220px;
    }
    .csp-cons-qr-modal-title {
        font-size: 16px;
    }
}

/* =============================================
   PRINT BUTTON & PRINT STYLES
   ============================================ */
.csp-cons-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
}
.csp-cons-print-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}
.csp-cons-print-btn i {
    font-size: 16px;
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
#csp-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
}

.csp-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    color: #1e293b;
    min-width: 280px;
}

.csp-toast.visible {
    transform: translateX(0);
    opacity: 1;
}

.csp-toast i:first-child {
    font-size: 20px;
    flex-shrink: 0;
}

.csp-toast-success i:first-child { color: #22c55e; }
.csp-toast-error i:first-child { color: #ef4444; }
.csp-toast-warning i:first-child { color: #f59e0b; }
.csp-toast-info i:first-child { color: #a78bfa; }

.csp-toast-message {
    flex: 1;
    line-height: 1.4;
}

.csp-toast-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
    flex-shrink: 0;
}

.csp-toast-close:hover {
    color: #64748b;
}

.csp-toast-close i {
    font-size: 14px;
}

/* Toast type borders */
.csp-toast-success { border-left: 4px solid #22c55e; }
.csp-toast-error { border-left: 4px solid #ef4444; }
.csp-toast-warning { border-left: 4px solid #f59e0b; }
.csp-toast-info { border-left: 4px solid #a78bfa; }

/* =============================================
   CONFIRM MODAL
   ============================================= */
.csp-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.csp-confirm-modal.visible {
    opacity: 1;
}

.csp-confirm-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.csp-confirm-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.csp-confirm-modal.visible .csp-confirm-content {
    transform: scale(1);
}

.csp-confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.csp-confirm-icon i {
    font-size: 32px;
}

.csp-confirm-icon.csp-confirm-warning {
    background: #fef3c7;
}
.csp-confirm-icon.csp-confirm-warning i {
    color: #f59e0b;
}

.csp-confirm-icon.csp-confirm-danger {
    background: #fee2e2;
}
.csp-confirm-icon.csp-confirm-danger i {
    color: #ef4444;
}

.csp-confirm-icon.csp-confirm-info {
    background: #ede9fe;
}
.csp-confirm-icon.csp-confirm-info i {
    color: #a78bfa;
}

.csp-confirm-icon.csp-confirm-success {
    background: #dcfce7;
}
.csp-confirm-icon.csp-confirm-success i {
    color: #22c55e;
}

.csp-confirm-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
}

.csp-confirm-message {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 24px;
}

.csp-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.csp-confirm-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    min-width: 100px;
}

.csp-confirm-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.csp-confirm-cancel:hover {
    background: #e2e8f0;
    color: #475569;
}

.csp-confirm-ok {
    color: #fff;
}

.csp-confirm-ok.csp-confirm-warning {
    background: #f59e0b;
}
.csp-confirm-ok.csp-confirm-warning:hover {
    background: #d97706;
}

.csp-confirm-ok.csp-confirm-danger {
    background: #ef4444;
}
.csp-confirm-ok.csp-confirm-danger:hover {
    background: #dc2626;
}

.csp-confirm-ok.csp-confirm-info {
    background: #a78bfa;
}
.csp-confirm-ok.csp-confirm-info:hover {
    background: #8b5cf6;
}

.csp-confirm-ok.csp-confirm-success {
    background: #22c55e;
}
.csp-confirm-ok.csp-confirm-success:hover {
    background: #16a34a;
}

/* =============================================
   SUCCESS MODAL (Vote confirmation etc.)
   ============================================= */
.csp-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.csp-success-modal.visible {
    opacity: 1;
}

.csp-success-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.csp-success-content {
    position: relative;
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.csp-success-modal.visible .csp-success-content {
    transform: scale(1);
}

.csp-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: csp-success-pulse 0.6s ease-out;
}

@keyframes csp-success-pulse {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.csp-success-icon i {
    font-size: 40px;
    color: #22c55e;
}

.csp-success-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
}

.csp-success-message {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 20px;
}

.csp-success-details {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: left;
}

.csp-success-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}

.csp-success-detail-row:last-child {
    border-bottom: none;
}

.csp-success-detail-label {
    color: #64748b;
}

.csp-success-detail-value {
    color: #1e293b;
    font-weight: 600;
    font-family: monospace;
    word-break: break-all;
    max-width: 60%;
    text-align: right;
}

.csp-success-btn {
    padding: 14px 32px;
    background: #a78bfa;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.csp-success-btn:hover {
    background: #8b5cf6;
    transform: translateY(-2px);
}

/* Mobile adjustments for modals */
@media (max-width: 480px) {
    #csp-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .csp-toast {
        min-width: auto;
    }

    .csp-confirm-content,
    .csp-success-content {
        padding: 24px;
    }

    .csp-confirm-buttons {
        flex-direction: column;
    }

    .csp-confirm-btn {
        width: 100%;
    }
}

/* Print styles */
@media print {
    body * {
        visibility: hidden;
    }
    .csp-cons-card,
    .csp-cons-card * {
        visibility: visible;
    }
    .csp-cons-card {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 20px;
        box-shadow: none;
        border: none;
    }
    /* Hide interactive elements when printing */
    .csp-cons-print-btn,
    .csp-cons-submit-btn,
    .csp-cons-qr-btn,
    .csp-cons-copy-btn,
    .csp-cons-view-toggle,
    .csp-cons-toolbar,
    .csp-cons-qr-modal,
    .csp-cons-vote-form input,
    .csp-cons-vote-form button {
        display: none !important;
    }
    /* Ensure results are visible */
    .csp-cons-results-dashboard {
        page-break-inside: avoid;
    }
    /* Better colors for print */
    .csp-cons-result-bar-fill {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* =============================================
   RULES DOCUMENT MODAL (PDF viewer)
   ============================================= */
.csp-rules-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.csp-rules-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.csp-rules-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.csp-rules-modal-header h3 i {
    color: #ef4444;
    margin-right: 8px;
}

.csp-rules-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.csp-rules-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.csp-rules-modal-body {
    flex: 1;
    overflow: hidden;
}

.csp-rules-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.csp-rules-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
}

.csp-rules-print-btn {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

.csp-rules-print-btn:hover {
    background: #e2e8f0 !important;
}

@media (max-width: 640px) {
    .csp-rules-modal-content {
        width: 98%;
        height: 90vh;
        border-radius: 12px;
    }
}

/* =============================================
   LIVE VOTERS MODAL
   ============================================= */
.csp-voters-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.csp-voters-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.csp-voters-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.csp-voters-modal-header h3 i {
    color: #8b5cf6;
    margin-right: 8px;
}

.csp-voters-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.csp-voters-table-wrapper {
    overflow-x: auto;
}

.csp-voters-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.csp-voter-th {
    background: #f8fafc;
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.csp-voter-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.csp-voter-row:hover {
    background: #faf5ff;
}

.csp-voter-td {
    padding: 10px 16px;
    color: #1e293b;
    vertical-align: middle;
}

.csp-voter-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.csp-voter-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

@media (max-width: 640px) {
    .csp-voters-modal-content {
        width: 98%;
        max-height: 90vh;
        border-radius: 12px;
    }
    .csp-voter-th,
    .csp-voter-td {
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* =============================================
   BUDDYBOSS "SHOW MORE" OVERRIDE
   ============================================= */
/* Zapobiegaj ukryciu karty przez BuddyBoss "show more" */
.activity-content .csp-cons-card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-height: none !important;
    overflow: visible !important;
}

/* =============================================
   CUSTOM FIXES
   ============================================= */
.csp-cons-view-btn {
    border: none !important;
    padding-top: 7px !important;
    line-height: 0px !important;
}
.csp-cons-view-btn i {
    color: #A78BFA !important;
}
.csp-cons-option-btn.selected,
.csp-cons-checkbox-btn.selected {
    border-color: #4f46e5 !important;
}
.csp-cons-options-container[data-current-view="list"] label.csp-cons-option-btn {
    flex-direction: row !important;
}
.csp-voters-modal-content{
  z-index: 99999999;
}
