/**
 * Help System Styles - Chytrá jednotka
 * Profesionální design pro systém nápovědy modulů
 * Verze 1.0
 */

/* ============================================
   HEADER HELP BUTTON
   ============================================ */
.header-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 0.75rem;
}

.header-help-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

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

.header-help-btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   HELP TRIGGER BUTTON
   ============================================ */
.help-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    position: relative;
    z-index: 10;
}

.help-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.help-trigger:active {
    transform: scale(0.95);
}

.help-trigger svg {
    width: 18px;
    height: 18px;
}

.help-trigger-inline {
    margin-left: auto;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Pokud je tlačítko uvnitř header-left, zarovnej doprava v rámci parent */
.incidents-header-left .help-trigger-inline,
.work-header-left .help-trigger-inline,
.training-header-left .help-trigger-inline,
.event-header-left .help-trigger-inline,
.board-header-left .help-trigger-inline {
    margin-left: 0.75rem;
}

/* Header help button */
.page-header-help {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ============================================
   HELP MODAL OVERLAY
   ============================================ */
.help-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 2rem 1rem;
    overflow-y: auto;
}

.help-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   HELP MODAL CONTAINER
   ============================================ */
.help-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: calc(100vh - 4rem);
    overflow: hidden;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.help-modal-overlay.active .help-modal {
    transform: translateY(0) scale(1);
}

/* ============================================
   HELP MODAL HEADER
   ============================================ */
.help-modal-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #0ea5e9 100%);
    padding: 1.5rem 2rem;
    position: relative;
    overflow: visible;
}

.help-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.help-modal-header-content {
    position: relative;
    z-index: 1;
}

.help-modal-header-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.help-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.help-modal-icon svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.help-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}

.help-modal-subtitle {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.5;
}

.help-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.help-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.help-modal-close svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   HELP MODAL BODY
   ============================================ */
.help-modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

/* ============================================
   HELP SECTIONS
   ============================================ */
.help-section {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.help-section:last-child {
    border-bottom: none;
}

.help-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.help-section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
}

.help-section-icon svg {
    width: 20px;
    height: 20px;
}

.help-section-icon.required {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
}

.help-section-icon.dependencies {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
}

.help-section-icon.howto {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #047857;
}

.help-section-icon.options {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #6d28d9;
}

.help-section-icon.tips {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #be185d;
}

.help-section-icon.video {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.help-section-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.help-section-content {
    color: #4b5563;
    font-size: 0.9375rem;
    line-height: 1.7;
}

.help-section-content p {
    margin: 0 0 0.75rem 0;
}

.help-section-content p:last-child {
    margin-bottom: 0;
}

/* ============================================
   HELP LISTS
   ============================================ */
.help-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-list li {
    position: relative;
    padding: 0.625rem 0 0.625rem 1.75rem;
    border-bottom: 1px dashed #e5e7eb;
}

.help-list li:last-child {
    border-bottom: none;
}

.help-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
}

.help-list.check-list li::before {
    content: '✓';
    width: auto;
    height: auto;
    background: none;
    color: #10b981;
    font-weight: 700;
    font-size: 0.875rem;
}

.help-list.warning-list li::before {
    content: '⚠';
    width: auto;
    height: auto;
    background: none;
    font-size: 0.75rem;
}

.help-list.numbered-list {
    counter-reset: help-counter;
}

.help-list.numbered-list li::before {
    counter-increment: help-counter;
    content: counter(help-counter);
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.help-list li strong {
    color: #1f2937;
}

/* ============================================
   HELP BADGES
   ============================================ */
.help-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.help-badge.required {
    background: #fef3c7;
    color: #b45309;
}

.help-badge.optional {
    background: #e5e7eb;
    color: #4b5563;
}

.help-badge.recommended {
    background: #d1fae5;
    color: #047857;
}

.help-badge.new {
    background: #dbeafe;
    color: #1d4ed8;
}

/* ============================================
   HELP CALLOUTS
   ============================================ */
.help-callout {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin: 1rem 0;
    display: flex;
    gap: 0.75rem;
}

.help-callout-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
}

.help-callout-content {
    flex: 1;
}

.help-callout-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.help-callout.info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #3b82f6;
}

.help-callout.info .help-callout-title {
    color: #1d4ed8;
}

.help-callout.warning {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border-left: 4px solid #eab308;
}

.help-callout.warning .help-callout-title {
    color: #a16207;
}

.help-callout.success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 4px solid #10b981;
}

.help-callout.success .help-callout-title {
    color: #047857;
}

.help-callout.danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid #ef4444;
}

.help-callout.danger .help-callout-title {
    color: #dc2626;
}

/* ============================================
   VIDEO SECTION
   ============================================ */
.help-video-container {
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
}

.help-video-placeholder {
    aspect-ratio: 16/9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

.help-video-placeholder-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
}

.help-video-placeholder-icon svg {
    width: 28px;
    height: 28px;
    color: #fff;
    margin-left: 4px;
}

.help-video-placeholder-text {
    color: #64748b;
    font-size: 0.9375rem;
}

.help-video-placeholder-text strong {
    display: block;
    color: #1f2937;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.help-video-iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
}

/* ============================================
   HELP TABLE
   ============================================ */
.help-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.help-table th,
.help-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.help-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.help-table tr:hover td {
    background: #f9fafb;
}

/* ============================================
   HELP FOOTER
   ============================================ */
.help-modal-footer {
    padding: 1rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.help-modal-footer-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.8125rem;
}

.help-modal-footer-info svg {
    width: 16px;
    height: 16px;
}

.help-modal-footer-actions {
    display: flex;
    gap: 0.75rem;
}

.help-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.help-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
}

.help-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.help-btn-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.help-btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* ============================================
   KEYBOARD SHORTCUT
   ============================================ */
.help-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.5rem;
    background: linear-gradient(180deg, #fff 0%, #f3f4f6 100%);
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    box-shadow: 0 2px 0 #d1d5db;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
body.dark-mode .help-modal {
    background: #1e293b;
}

body.dark-mode .help-modal-title {
    color: #fff;
}

body.dark-mode .help-section {
    border-bottom-color: #334155;
}

body.dark-mode .help-section-title {
    color: #f1f5f9;
}

body.dark-mode .help-section-content {
    color: #94a3b8;
}

body.dark-mode .help-list li {
    border-bottom-color: #334155;
}

body.dark-mode .help-list li strong {
    color: #e2e8f0;
}

body.dark-mode .help-table th {
    background: #0f172a;
    color: #e2e8f0;
}

body.dark-mode .help-table td {
    border-bottom-color: #334155;
}

body.dark-mode .help-table tr:hover td {
    background: #334155;
}

body.dark-mode .help-modal-footer {
    background: #0f172a;
    border-top-color: #334155;
}

body.dark-mode .help-btn-secondary {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

body.dark-mode .help-btn-secondary:hover {
    background: #475569;
}

body.dark-mode .help-video-container {
    background: #0f172a;
}

body.dark-mode .help-video-placeholder-text {
    color: #94a3b8;
}

body.dark-mode .help-video-placeholder-text strong {
    color: #e2e8f0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .help-modal-overlay {
        padding: 1rem 0.5rem;
    }
    
    .help-modal {
        border-radius: 12px;
        max-height: calc(100vh - 2rem);
    }
    
    .help-modal-header {
        padding: 1.25rem 1.5rem;
    }
    
    .help-modal-title {
        font-size: 1.25rem;
    }
    
    .help-section {
        padding: 1.25rem 1.5rem;
    }
    
    .help-modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
        text-align: center;
    }
    
    .help-modal-footer-actions {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .help-modal-header {
        padding: 1rem 1.25rem;
    }
    
    .help-section {
        padding: 1rem 1.25rem;
    }
    
    .help-list li {
        padding-left: 1.5rem;
    }
    
    .help-table {
        font-size: 0.8125rem;
    }
    
    .help-table th,
    .help-table td {
        padding: 0.5rem 0.75rem;
    }
}
