/* Bootstrap Icons */
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css");;

/* FINOS AI Governance Framework - Optimized Styles */

/* External link icon styling */
.external-link-icon {
    flex-shrink: 0;
    transition: none !important;
    transform: none !important;
}

/* ID styling for risks and mitigations */
.risk-id {
    font-family: monospace;
    font-size: 0.8rem;
    color: #0d6efd;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.mitigation-id {
    font-family: monospace;
    font-size: 0.8rem;
    color: #198754;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Card styling and interactions */
.card {
    transition: all 0.2s ease-in-out;
    border: none;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.12) !important;
}

/* Search and filter controls styling */
.card.bg-light {
    background-color: #f8f9fa !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08) !important;
    border: 1px solid #e9ecef !important;
}

.card.bg-light:hover {
    transform: none !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08) !important;
}

/* Tab navigation styling */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 0;
    color: #6c757d;
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: all 0.2s ease-in-out;
}

.nav-tabs .nav-link:hover {
    border: none;
    background-color: #f8f9fa;
    color: #495057;
}

.nav-tabs .nav-link.active {
    border: none;
    border-bottom: 3px solid #0d6efd;
    background-color: transparent;
    color: #0d6efd;
    font-weight: 600;
}

.tab-content {
    padding-top: 1.5rem;
}

/* Specific hover effects for catalogue items */
.risk-item .card:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 15px rgba(13, 110, 253, 0.15) !important;
}

.mitigation-item .card:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 15px rgba(25, 135, 84, 0.15) !important;
}

/* Clickable card styling */
.card-hover {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-2px);
}

/* Link styling for clickable cards */
a.text-decoration-none:hover .card-hover {
    text-decoration: none !important;
}

/* Collapsed filter panel styling */
.filter-panel-collapsed {
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.filter-panel-expanded {
    max-height: 500px;
    transition: max-height 0.3s ease-in-out;
}

.filter-toggle-btn {
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.filter-toggle-btn:hover {
    transform: scale(1.05);
}

.filter-toggle-btn.collapsed {
    transform: rotate(180deg);
}

/* Form controls */
.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Optgroup styling */
optgroup {
    font-weight: 600;
    color: #495057;
    font-style: normal;
}

optgroup option {
    font-weight: 400;
    padding-left: 1rem;
}

/* Button styling */
.btn:hover {
    transform: none !important;
}

/* Expand button styling */
.expand-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.expand-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Badge styling */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Category headers */
.h5.text-primary {
    color: #0d6efd !important;
    font-weight: 600;
}

.h5.text-success {
    color: #198754 !important;
    font-weight: 600;
}

/* Border styling */
.border-start.border-primary {
    border-left-width: 4px !important;
}

.border-start.border-success {
    border-left-width: 4px !important;
}

/* Collapse functionality */
.collapse:not(.show) {
    display: none;
}

.collapse.show {
    display: block;
}

.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .row.g-2 > * {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }
    
    .row.g-3 > * {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }
}

@media (max-width: 576px) {
    .h4 {
        font-size: 1.1rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Accessibility */
.card:focus-within {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

a:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .btn, 
    .collapse-btn,
    .form-control,
    .form-select {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
}

/* Button group styling for stacked buttons */
.d-flex.flex-column.gap-1 {
    min-width: 70px;
}

.d-flex.flex-column.gap-1 .btn {
    margin: 0;
    min-width: 70px;
    white-space: nowrap;
}

.d-flex.flex-column.gap-1 .btn:first-child {
    margin-bottom: 0.25rem;
}

/* Responsive description text truncation */
.description-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    max-height: 2.8em; /* 2 lines * 1.4 line-height */
}

/* Expanded view - allow more text */
.col-12 .description-text {
    -webkit-line-clamp: 4;
    line-clamp: 4;
    max-height: 5.6em; /* 4 lines * 1.4 line-height */
}

/* Mobile responsiveness for descriptions */
@media (max-width: 768px) {
    .description-text {
        -webkit-line-clamp: 3;
        line-clamp: 3;
        max-height: 4.2em; /* 3 lines * 1.4 line-height */
    }
    
    .col-12 .description-text {
        -webkit-line-clamp: 5;
        line-clamp: 5;
        max-height: 7em; /* 5 lines * 1.4 line-height */
    }
}

@media (max-width: 576px) {
    .description-text {
        -webkit-line-clamp: 2;
        line-clamp: 2;
        max-height: 2.8em;
    }
    
    .col-12 .description-text {
        -webkit-line-clamp: 4;
        line-clamp: 4;
        max-height: 5.6em;
    }
}
