/* Default CSS */
/* Generated by the CoffeeCup HTML Editor - www.coffeecup.com */

 :root {
            --primary-color: #3498db;
            --secondary-color: #2980b9;
            --threat-color: #e74c3c;
            --consequence-color: #27ae60;
            --control-preventive: #f39c12;
            --control-mitigating: #8e44ad;
            --light-gray: #ecf0f1;
            --medium-gray: #bdc3c7;
            --dark-gray: #7f8c8d;
            --risk-high: #e74c3c;
            --risk-medium: #f39c12;
            --risk-low: #2ecc71;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: #333;
            background-color: #f5f7fa;
            padding: 20px;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 20px;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        h1, h2, h3 {
            color: #2c3e50;
            margin-bottom: 15px;
        }

        h1 {
            text-align: center;
            margin-bottom: 25px;
            color: var(--primary-color);
            border-bottom: 2px solid var(--light-gray);
            padding-bottom: 10px;
        }

        h2 {
            font-size: 1.4rem;
            background-color: var(--light-gray);
            padding: 8px 12px;
            border-radius: 4px;
            margin-top: 20px;
        }

        .input-section, .threats-section, .consequences-section, .visualization, .data-export {
            margin-bottom: 30px;
            padding: 15px;
            background-color: white;
            border-radius: 6px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .form-row {
            display: flex;
            gap: 15px;
            margin-bottom: 15px;
        }

        .form-group {
            flex: 1;
            margin-bottom: 0;
        }

        label {
            display: block;
            margin-bottom: 5px;
            font-weight: 600;
            color: var(--dark-gray);
        }

        input[type="text"], input[type="number"], select {
            width: 100%;
            padding: 10px;
            border: 1px solid var(--medium-gray);
            border-radius: 4px;
            font-size: 1rem;
            transition: border 0.3s;
        }

        input[type="text"]:focus, input[type="number"]:focus, select:focus {
            border-color: var(--primary-color);
            outline: none;
            box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
        }

        button {
            background-color: var(--primary-color);
            color: white;
            border: none;
            padding: 10px 15px;
            border-radius: 4px;
            cursor: pointer;
            margin-right: 10px;
            margin-bottom: 10px;
            font-size: 0.9rem;
            transition: all 0.3s;
        }

        button:hover {
            background-color: var(--secondary-color);
            transform: translateY(-1px);
        }

        button:active {
            transform: translateY(0);
        }

        .btn-secondary {
            background-color: var(--medium-gray);
        }

        .btn-danger {
            background-color: var(--threat-color);
        }

        .btn-success {
            background-color: var(--consequence-color);
        }

        .threat-item, .consequence-item {
            background-color: var(--light-gray);
            padding: 12px;
            margin-bottom: 12px;
            border-radius: 4px;
            position: relative;
        }

        .threat-item {
            border-left: 4px solid var(--threat-color);
        }

        .consequence-item {
            border-left: 4px solid var(--consequence-color);
        }

        .risk-badge {
            display: inline-block;
            padding: 3px 8px;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: bold;
            margin-left: 8px;
        }

        .risk-high {
            background-color: var(--risk-high);
            color: white;
        }

        .risk-medium {
            background-color: var(--risk-medium);
            color: white;
        }

        .risk-low {
            background-color: var(--risk-low);
            color: white;
        }

        .controls {
            margin-top: 8px;
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
        }

        .controls button {
            padding: 5px 10px;
            font-size: 0.8rem;
        }

        .threat-item .controls button {
            background-color: var(--threat-color);
        }

        .consequence-item .controls button {
            background-color: var(--consequence-color);
        }

        .control-item {
            background-color: white;
            padding: 8px;
            margin-top: 8px;
            border-radius: 4px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.9rem;
            box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        }

        .control-item .control-info {
            flex: 1;
        }

        .control-item .control-actions {
            margin-left: 10px;
        }

        .control-item button {
            padding: 3px 6px;
            margin-left: 5px;
            background-color: var(--dark-gray);
            font-size: 0.7rem;
        }

        .effectiveness-bar {
            height: 6px;
            background-color: #ddd;
            border-radius: 3px;
            margin-top: 4px;
            overflow: hidden;
        }

        .effectiveness-fill {
            height: 100%;
            background-color: var(--primary-color);
        }

        #bowtieDiagram {
            width: 100%;
            min-height: 500px;
            border: 1px solid var(--medium-gray);
            margin-top: 20px;
            position: relative;
            background-color: white;
            border-radius: 6px;
            padding: 20px;
            overflow: auto;
        }

        .hazard-display, .top-event-display {
            text-align: center;
            font-weight: bold;
            margin-bottom: 20px;
            padding: 12px;
            background-color: var(--light-gray);
            border-radius: 4px;
        }

        .top-event-display {
            background-color: var(--primary-color);
            color: white;
            margin: 20px auto;
            max-width: 400px;
            font-size: 1.2rem;
        }

        .bowtie-visual-container {
            display: flex;
            justify-content: space-between;
            margin-top: 20px;
        }

        .threats-visual, .consequences-visual {
            width: 48%;
        }

        .threat-vis, .consequence-vis {
            margin-bottom: 20px;
            padding: 12px;
            border-radius: 4px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        .threat-vis {
            background-color: rgba(231, 76, 60, 0.05);
            border-left: 4px solid var(--threat-color);
        }

        .consequence-vis {
            background-color: rgba(39, 174, 96, 0.05);
            border-left: 4px solid var(--consequence-color);
        }

        .control-vis {
            padding: 8px;
            margin: 8px 0 8px 20px;
            border-radius: 4px;
            font-size: 0.9rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .preventive {
            background-color: rgba(243, 156, 18, 0.1);
            border-left: 3px solid var(--control-preventive);
        }

        .mitigating {
            background-color: rgba(142, 68, 173, 0.1);
            border-left: 3px solid var(--control-mitigating);
        }

        .control-vis .control-meta {
            font-size: 0.8rem;
            color: var(--dark-gray);
        }

        .risk-matrix {
            display: inline-grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 2px;
            margin-left: 10px;
        }

        .risk-cell {
            width: 16px;
            height: 16px;
            border-radius: 2px;
            cursor: pointer;
            border: 1px solid #ddd;
        }

        .risk-cell.selected {
            transform: scale(1.2);
            box-shadow: 0 0 0 2px var(--primary-color);
        }

        .summary-panel {
            margin-top: 30px;
            padding: 15px;
            background-color: var(--light-gray);
            border-radius: 6px;
        }

        .summary-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 15px;
            margin-top: 15px;
        }

        .summary-card {
            background-color: white;
            padding: 12px;
            border-radius: 4px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        /* Responsive Design */
        @media (max-width: 992px) {
            .form-row {
                flex-direction: column;
                gap: 15px;
            }
        }

        @media (max-width: 768px) {
            .bowtie-visual-container {
                flex-direction: column;
            }
            
            .threats-visual, .consequences-visual {
                width: 100%;
                margin-bottom: 20px;
            }
            
            .container {
                padding: 15px;
            }
            
            h1 {
                font-size: 1.5rem;
            }
            
            h2 {
                font-size: 1.2rem;
            }

            .summary-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 480px) {
            body {
                padding: 10px;
            }
            
            .controls {
                flex-direction: column;
            }
            
            button {
                width: 100%;
                margin-bottom: 8px;
            }
        }

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

        .threat-item, .consequence-item, .control-item {
            animation: fadeIn 0.3s ease-out;
        }

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal-content {
            background-color: white;
            padding: 25px;
            border-radius: 8px;
            max-width: 800px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 4px 20px rgba(0,0,0,0.2);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--light-gray);
        }

        .modal-title {
            font-size: 1.4rem;
            color: var(--primary-color);
        }

        .close-modal {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--dark-gray);
        }

        .modal-body {
            margin-bottom: 20px;
        }

        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }

        /* Tab Styles */
        .tabs {
            display: flex;
            border-bottom: 1px solid var(--medium-gray);
            margin-bottom: 20px;
        }

        .tab {
            padding: 10px 20px;
            cursor: pointer;
            border-bottom: 3px solid transparent;
        }

        .tab.active {
            border-bottom-color: var(--primary-color);
            font-weight: bold;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        /* Toast Styles */
        .toast {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            padding: 12px 24px;
            background-color: #333;
            color: white;
            border-radius: 4px;
            opacity: 0;
            transition: opacity 0.3s;
            z-index: 1000;
        }
        .toast.show {
            opacity: 1;
        }
        .toast-success {
            background-color: #27ae60;
        }
        .toast-error {
            background-color: #e74c3c;
        }