/**
 * Main Tabs - Ocena Ryzyka
 * Style dla głównych zakładek (Dokument | Tabela)
 */

/* Kontener główny */
.ocena-ryzyka-main-wrapper {
    width: 100%;
    max-width: 100%;
}

/* ========================================
   TOOLBAR - Panel zarządzania projektem
   ======================================== */
.ocena-ryzyka-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 15px 20px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.ocena-ryzyka-common-toolbar {
    max-width: 100%;
}

.toolbar-left {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Auto-save status */
.autosave-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
    font-size: 13px;
}

.status-icon {
    font-size: 16px;
}

/* Informacja o projekcie */
.projekt-info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.projekt-kod {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 16px;
    color: #0066cc;
    background: white;
    padding: 5px 10px;
    border-radius: 3px;
}

/* Zakładki główne (50/50) */
.ocena-ryzyka-main-tabs {
    display: flex;
    gap: 0;
    border-bottom: 3px solid #dee2e6;
    background: #f8f9fa;
    margin-bottom: 0;
}

.ocena-ryzyka-main-tab {
    flex: 1; /* Każda zakładka zajmuje 50% szerokości */
    padding: 20px 30px;
    background: #e9ecef;
    color: #6c757d;
    border: none;
    border-bottom: 4px solid transparent;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.ocena-ryzyka-main-tab:hover {
    background: #dee2e6;
    color: #495057;
}

.ocena-ryzyka-main-tab.active {
    background: #ffffff;
    color: #007bff;
    border-bottom: 4px solid #007bff;
}

/* Zawartość zakładek */
.ocena-ryzyka-main-tab-content {
    display: none; /* Ukryte domyślnie */
    width: 100%;
    animation: fadeIn 0.3s ease-in;
}

.ocena-ryzyka-main-tab-content.active {
    display: block; /* Widoczne gdy aktywne */
}

/* Animacja pojawienia się */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Przełącznik użytkownika zaawansowanego */
.or-advanced-user-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 15px;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.or-advanced-user-toggle:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.or-toggle-label {
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    line-height: 1.3;
}

.or-toggle-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* Ukryj checkbox */
.or-toggle-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Toggle switch */
.or-toggle-switch {
    position: relative;
    width: 35px;  /* 44px * 0.8 = 35.2px */
    height: 19px; /* 24px * 0.8 = 19.2px */
    background-color: #ccc;
    border-radius: 10px; /* 12px * 0.8 = 9.6px */
    transition: background-color 0.3s;
    flex-shrink: 0;
}

/* Toggle switch slider */
.or-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 15px; /* 20px * 0.8 = 16px */
    height: 15px; /* 20px * 0.8 = 16px */
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Checked state - background */
.or-toggle-container input[type="checkbox"]:checked ~ .or-toggle-switch {
    background-color: #007bff;
}

/* Checked state - slider position */
.or-toggle-container input[type="checkbox"]:checked ~ .or-toggle-switch::after {
    transform: translateX(16px); /* 20px * 0.8 = 16px */
}

/* Responsywność */
@media (max-width: 768px) {
    .ocena-ryzyka-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: center;
    }

    .toolbar-right {
        flex-wrap: wrap;
    }

    .ocena-ryzyka-main-tab {
        padding: 15px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .ocena-ryzyka-toolbar {
        padding: 10px 15px;
    }

    .toolbar-left {
        flex-direction: column;
    }

    .toolbar-left .btn {
        width: 100%;
    }

    .autosave-status {
        width: 100%;
        justify-content: center;
    }

    .or-advanced-user-toggle {
        width: 100%;
        justify-content: center;
    }

    .projekt-info {
        flex-direction: column;
        text-align: center;
    }

    .ocena-ryzyka-main-tabs {
        flex-direction: column;
    }

    .ocena-ryzyka-main-tab {
        width: 100%;
        border-bottom: none;
        border-left: 4px solid transparent;
    }

    .ocena-ryzyka-main-tab.active {
        border-bottom: none;
        border-left: 4px solid #007bff;
    }
}
