/*
 * ActProof.ai Modern Dashboard CSS
 * Expert-level UI/UX improvements
 * Focus: Progressive disclosure, visual hierarchy, micro-interactions
 */

/* ============================================
   EXECUTIVE SUMMARY - MODERN REDESIGN
   ============================================ */

.executive-summary {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.95) 0%, rgba(17, 24, 39, 0.95) 100%);
    border: 2px solid rgba(124, 58, 237, 0.3);
    border-radius: 24px;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.3),
                0 0 80px rgba(139, 92, 246, 0.1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.executive-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.1), transparent 70%);
    pointer-events: none;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

.summary-header h2 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f5f5f5 0%, #a3a3a3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.summary-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
}

.meta-item svg {
    width: 16px;
    height: 16px;
}

.summary-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

@media (max-width: 1024px) {
    .summary-content {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SCORE CARD HERO - REDESIGNED
   ============================================ */

.score-card-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-card-hero:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 12px 40px rgba(124, 58, 237, 0.2);
}

.score-circle {
    position: relative;
    width: 200px;
    height: 200px;
}

.score-ring {
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 20px currentColor);
}

.score-ring-bg {
    stroke: rgba(255, 255, 255, 0.05);
    transition: stroke 0.3s ease;
}

.score-ring-progress {
    transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1),
                stroke 0.3s ease;
    stroke-linecap: round;
}

.score-value-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: countUp 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-max {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.25rem;
}

.score-info {
    text-align: center;
    width: 100%;
}

.score-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.status-badge.status-compliant {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: #10b981;
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.status-badge.status-non-compliant {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #ef4444;
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.risk-badge {
    display: inline-flex;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.risk-badge.risk-minimal,
.risk-badge.risk-low {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.08) 100%);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.risk-badge.risk-medium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.08) 100%);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.risk-badge.risk-high,
.risk-badge.risk-critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.08) 100%);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================
   QUICK ACTIONS - MODERN
   ============================================ */

.quick-actions {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 20px;
}

.quick-actions h4 {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1.5px solid rgba(124, 58, 237, 0.3);
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn:hover {
    transform: translateY(-4px);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 12px 40px rgba(124, 58, 237, 0.3);
}

.action-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.action-btn:hover svg {
    transform: scale(1.1);
}

/* ============================================
   BUTTON SUBSCRIPTION WALL
   ============================================ */

.button-subscription-wall {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border: 1px solid rgba(139, 92, 246, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.button-subscription-wall:hover {
    background: rgba(10, 10, 10, 0.9);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.button-subscription-wall-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.button-subscription-wall-content svg {
    width: 20px;
    height: 20px;
    color: #8b5cf6;
}

.button-subscription-wall-content span {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* ============================================
   RAW JSON SUBSCRIPTION WALL
   ============================================ */

.raw-json-subscription-wall {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.raw-json-subscription-wall-content {
    text-align: center;
    padding: 3.5rem 2.5rem;
    max-width: 350px;
}

.raw-json-subscription-wall-content .unlock-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: grayscale(0.3);
}

.raw-json-subscription-wall-content h4 {
    color: var(--text-primary, #f5f5f5);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.raw-json-subscription-wall-content p {
    color: var(--text-secondary, #d4d4d4);
    font-size: 0.875rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.raw-json-subscription-wall-content .btn {
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.85) 0%, rgba(67, 56, 202, 0.8) 50%, rgba(79, 70, 229, 0.75) 100%);
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.35);
    padding: 0.875rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 12px -2px rgba(88, 28, 135, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.raw-json-subscription-wall-content .btn:hover {
    background: linear-gradient(135deg, rgba(107, 33, 168, 0.9) 0%, rgba(99, 102, 241, 0.85) 100%);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px -4px rgba(88, 28, 135, 0.45);
}

/* ============================================
   GENERIC TAB SUBSCRIPTION WALL
   (Used for all Detailed Analysis tabs)
   ============================================ */

.tab-subscription-wall {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border: 1px solid rgba(139, 92, 246, 0.3);
    cursor: pointer;
    min-height: 400px;
}

.tab-subscription-wall-content {
    text-align: center;
    padding: 3.5rem 2.5rem;
    max-width: 350px;
}

.tab-subscription-wall-content .unlock-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: grayscale(0.3);
}

.tab-subscription-wall-content h4 {
    color: var(--text-primary, #f5f5f5);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tab-subscription-wall-content p {
    color: var(--text-secondary, #d4d4d4);
    font-size: 0.875rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.tab-subscription-wall-content .btn {
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.85) 0%, rgba(67, 56, 202, 0.8) 50%, rgba(79, 70, 229, 0.75) 100%);
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.35);
    padding: 0.875rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 12px -2px rgba(88, 28, 135, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.tab-subscription-wall-content .btn:hover {
    background: linear-gradient(135deg, rgba(107, 33, 168, 0.9) 0%, rgba(99, 102, 241, 0.85) 100%);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px -4px rgba(88, 28, 135, 0.45);
}

/* Ensure tab pane is positioned relative for overlay */
.tab-pane {
    position: relative;
    min-height: 400px;
}

/* ============================================
   CRITICAL ALERTS - ENHANCED
   ============================================ */

.critical-alerts {
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.critical-alerts:not(.hidden) {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 20px;
    padding: 2rem;
}

.alerts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.alerts-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ef4444;
    margin: 0;
}

.alerts-count {
    padding: 0.375rem 0.875rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #ef4444;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert-item {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.alert-item:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(239, 68, 68, 0.4);
}

/* ============================================
   VISUAL DASHBOARD - KPI CARDS REDESIGNED
   ============================================ */

.visual-dashboard {
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.visual-dashboard h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.kpi-card {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.8) 0%, rgba(17, 24, 39, 0.8) 100%);
    border: 2px solid rgba(124, 58, 237, 0.2);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(124, 58, 237, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.kpi-card:hover {
    transform: translateY(-8px);
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.3);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.kpi-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px currentColor);
}

.kpi-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.kpi-value {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: countUp 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   COMPLIANCE EXTENDED SECTIONS - COLLAPSIBLE
   ============================================ */

.compliance-extended-section {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.6) 0%, rgba(17, 24, 39, 0.6) 100%);
    border: 1.5px solid rgba(124, 58, 237, 0.2);
    border-radius: 16px;
    padding: 0;
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.compliance-extended-section h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
}

.compliance-extended-section h3 > span {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.compliance-extended-section h3 .collapse-arrow {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.3s ease;
    margin-left: auto;
}

.compliance-extended-section.collapsed h3 .collapse-arrow {
    transform: rotate(-90deg);
}

.compliance-extended-section h3:hover {
    background: rgba(124, 58, 237, 0.1);
}

.compliance-extended-section h3:hover .collapse-arrow {
    color: rgba(255, 255, 255, 0.9);
}

.compliance-extended-section > div:first-of-type {
    padding: 0 2rem 2rem 2rem;
    max-height: 10000px;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease,
                padding 0.3s ease;
    overflow: hidden;
}

.compliance-extended-section.collapsed > div:first-of-type {
    max-height: 0;
    opacity: 0;
    padding: 0 2rem;
}

/* Section status checkmark for empty/no-issues sections */
.compliance-extended-section .section-status-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #10b981;
    margin-left: auto;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.compliance-extended-section.section-no-issues h3 {
    color: rgba(16, 185, 129, 0.9);
}

.compliance-extended-section.section-no-issues h3 .section-status-check svg {
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.5));
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes countUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   CLOSE BUTTON - MODERN
   ============================================ */

.btn-close-results {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.btn-close-results:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    transform: rotate(90deg) scale(1.1);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .executive-summary {
        padding: 2rem 1.5rem;
    }

    .summary-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .score-circle {
        width: 160px;
        height: 160px;
    }

    .score-value {
        font-size: 3rem;
    }

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

    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
