/* Policy Behaviors Styles */

/* Policy behavior card styling */
.policy-behavior-card {
    background: rgba(15, 15, 25, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
}

.policy-behavior-card:hover {
    background: rgba(20, 20, 35, 0.7);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

/* Control section styling */
.control-section {
    padding-left: 1rem;
    margin-top: 0.75rem;
    border-left: 2px solid rgba(139, 92, 246, 0.3);
    animation: fadeIn 0.3s ease;
}

/* RAG results styling */
.rag-results {
    margin-top: 0.5rem;
}

.rag-result {
    background: rgba(10, 10, 15, 0.5);
    border: 1px solid rgba(75, 75, 100, 0.2);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.rag-result:hover {
    background: rgba(15, 15, 25, 0.6);
    border-color: rgba(139, 92, 246, 0.3);
}

/* Line clamp utility for content preview */
.nz-line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Control type badges */
.control-type-law {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.control-type-policy {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.control-type-regulation {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.control-type-bylaw {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.control-type-code {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.control-type-other {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Intelligence section styling */
.intelligence-section {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 4px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.intelligence-section ul {
    margin-left: 1rem;
    margin-top: 0.25rem;
}

.intelligence-section li {
    font-size: 0.75rem;
    color: rgba(196, 181, 253, 0.9);
    margin-bottom: 0.25rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Expandable icon animation */
.policy-behavior-card .fa-chevron-down {
    transition: transform 0.3s ease;
}

/* Score color indicators */
.score-high {
    color: #4ade80;
}

.score-medium {
    color: #fbbf24;
}

.score-low {
    color: #fb923c;
}

/* Empty state styling */
#policiesContainer .nz-flex.nz-flex-col {
    min-height: 200px;
}

#policiesContainer .fa-book-open {
    font-size: 3rem;
    opacity: 0.2;
    margin-bottom: 1rem;
}

/* Refresh button animation */
#refreshPoliciesBtn:disabled .fa-sync-alt {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Last update text styling */
#policiesLastUpdate {
    font-size: 0.7rem;
    color: rgba(156, 163, 175, 0.6);
    font-style: italic;
}

/* GROUP 2B ENHANCEMENTS: New policy card styling */

/* Enhanced policy card with glass morphism */
.policy-behavior-card {
    background: rgba(30, 35, 45, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(100, 110, 130, 0.35);
    border-radius: 4px;
    transition: all 250ms ease;
    cursor: default;
}

.policy-behavior-card:hover {
    background: rgba(35, 40, 50, 0.7);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
}

/* Policy card header styling */
.policy-behavior-card .nz-cursor-pointer {
    cursor: pointer;
    transition: all 250ms ease;
}

.policy-behavior-card .nz-cursor-pointer:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 0.25rem;
    margin: -0.25rem;
}

/* Expandable content styling */
.policy-content {
    animation: fadeIn 250ms ease;
}

/* Analysis section styling */
.policy-content .nz-mb-sm:first-child {
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 4px;
    padding: 0.75rem;
    margin-top: 0.75rem;
}

/* Behaviors section enhanced styling */
.behaviors-section {
    background: rgba(15, 15, 25, 0.4);
    border: 1px solid rgba(75, 75, 100, 0.2);
    border-radius: 4px;
    padding: 0.75rem;
}

.behaviors-section h5 {
    color: rgba(235, 240, 255, 0.92);
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* Individual behavior items */
.behavior-item {
    background: rgba(25, 30, 40, 0.5);
    border-left: 2px solid rgba(139, 92, 246, 0.6);
    border-radius: 4px;
    transition: all 250ms ease;
}

.behavior-item:hover {
    background: rgba(30, 35, 45, 0.6);
    border-left-color: rgba(139, 92, 246, 0.8);
    transform: translateX(2px);
}

.behavior-text {
    color: rgba(235, 240, 255, 0.92);
    line-height: 1.4;
}

.behavior-meta {
    color: rgba(175, 190, 225, 0.68);
}

.behavior-reason {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    padding: 0.25rem 0.5rem;
    border-left: 2px solid rgba(59, 130, 246, 0.4);
}

/* Priority badges enhanced */
.nz-badge {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Action buttons styling */
.nz-button-ghost {
    background: transparent;
    border: 1px solid transparent;
    transition: all 250ms ease;
}

.nz-button-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Control button enhancements */
#analyzePoliciesBtn {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: rgba(196, 181, 253, 0.9);
}

#analyzePoliciesBtn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    color: rgba(196, 181, 253, 1);
}

#analyzePoliciesBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#analyzePoliciesBtn:disabled .fa-brain {
    animation: pulse 2s ease-in-out infinite;
}

/* Details section styling */
.nz-border-glass {
    border-color: rgba(100, 110, 130, 0.2) !important;
}

.policy-content .nz-grid {
    gap: 0.5rem 1rem;
}

.policy-content .nz-grid > div {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    border-left: 2px solid rgba(75, 85, 99, 0.4);
}

/* Score indicators enhanced */
.score-high {
    color: #4ade80;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.3);
}

.score-medium {
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.score-low {
    color: #fb923c;
    text-shadow: 0 0 8px rgba(251, 146, 60, 0.3);
}

/* Flagged policy styling */
.policy-behavior-card.nz-border-yellow-400 {
    border-color: rgba(251, 191, 36, 0.6) !important;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
}

.policy-behavior-card.nz-border-yellow-400::before {
    content: "🚩";
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 1.2rem;
    z-index: 10;
}

/* Button group spacing */
.nz-space-x-xs > * + * {
    margin-left: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .policy-behavior-card {
        margin-bottom: 0.75rem;
    }

    .nz-grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .behaviors-section {
        padding: 0.5rem;
    }

    .behavior-item {
        padding: 0.5rem;
    }
}

/* Enhanced animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.behavior-item {
    animation: slideInFromLeft 250ms ease forwards;
}

.behavior-item:nth-child(n) {
    animation-delay: calc(var(--index, 0) * 50ms);
}

/* Loading state for analyze button */
.fa-spin {
    animation: spin 1s linear infinite;
}

/* Visual feedback for interactions */
.policy-behavior-card[data-policy-id]:focus-within {
    outline: 2px solid rgba(139, 92, 246, 0.5);
    outline-offset: 2px;
}

/* Text selection styling */
.policy-behavior-card ::selection {
    background: rgba(139, 92, 246, 0.3);
    color: rgba(235, 240, 255, 1);
}