/* Adaptive Dashboard Styles */
.customizable-dashboard {
    position: relative;
    width: 100%;
    height: 300px;
    background: rgba(29, 12, 70, 0.05);
    border-radius: 12px;
    padding: 1rem;
    overflow: hidden;
    perspective: 1000px;
}

.dashboard-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.team-label {
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: #1d0c46;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 10;
}

.team-label.active {
    opacity: 1;
}

.dashboard-widget {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.8rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.widget-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #1d0c46;
    margin: 0 0 0.5rem 0;
}

/* KPI Widget */
.kpi-widget {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1d0c46;
    margin-bottom: 0.3rem;
    animation: kpiPulse 2s ease-in-out infinite;
}

.kpi-label {
    font-size: 0.6rem;
    color: #1d0c46;
    opacity: 0.8;
}

@keyframes kpiPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Line Chart Widget */
.line-chart-widget {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
}

.chart-container {
    flex: 1;
    position: relative;
    margin-top: 0.5rem;
}

.chart-line {
    width: 100%;
    height: 60px;
}

.chart-path {
    fill: none;
    stroke: #1d0c46;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawLine 2s ease-out 0.5s forwards;
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

/* Pie Chart Widget */
.pie-chart-widget {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pie-chart {
    width: 80px;
    height: 80px;
    margin: 0.5rem auto;
    position: relative;
}

.pie-slice {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%);
    animation: pieGrow 1.5s ease-out 1s forwards;
    transform-origin: center;
}

.pie-slice-1 {
    background: conic-gradient(#1d0c46 0deg 120deg, transparent 120deg 360deg);
}

.pie-slice-2 {
    background: conic-gradient(transparent 0deg 120deg, #6b5b7a 120deg 240deg, transparent 240deg 360deg);
}

.pie-slice-3 {
    background: conic-gradient(transparent 0deg 240deg, #4a3a6b 240deg 360deg);
}

@keyframes pieGrow {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Bar Chart Widget */
.bar-chart-widget {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
}

/* Additional Widgets for Leadership and Marketing Views */
.metrics-widget {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.metrics-widget.active {
    opacity: 1;
    transform: scale(1);
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.metric-item {
    text-align: center;
    padding: 0.3rem;
    background: rgba(29, 12, 70, 0.1);
    border-radius: 4px;
}

.metric-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1d0c46;
    display: block;
    margin-bottom: 0.2rem;
}

.metric-label {
    font-size: 0.5rem;
    color: #1d0c46;
    opacity: 0.8;
}

/* Revenue Widget */
.revenue-widget {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.revenue-widget.active {
    opacity: 1;
    transform: scale(1);
}

.revenue-chart {
    display: flex;
    align-items: end;
    gap: 0.2rem;
    height: 40px;
    margin-top: 0.5rem;
}

.revenue-bar {
    flex: 1;
    background: linear-gradient(to top, #1d0c46, #6b5b7a);
    border-radius: 2px 2px 0 0;
    animation: revenueGrow 1.5s ease-out 1.2s forwards;
    transform-origin: bottom;
    height: 0;
}

.revenue-bar:nth-child(1) { animation-delay: 1.2s; }
.revenue-bar:nth-child(2) { animation-delay: 1.4s; }
.revenue-bar:nth-child(3) { animation-delay: 1.6s; }
.revenue-bar:nth-child(4) { animation-delay: 1.8s; }
.revenue-bar:nth-child(5) { animation-delay: 2s; }

@keyframes revenueGrow {
    0% { height: 0; }
    100% { height: var(--bar-height, 60%); }
}

/* Growth Widget */
.growth-widget {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.growth-widget.active {
    opacity: 1;
    transform: scale(1);
}

.growth-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
}

.growth-arrow {
    font-size: 1.5rem;
    color: #1d0c46;
    margin-right: 0.3rem;
    animation: growthPulse 2s ease-in-out infinite;
}

@keyframes growthPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Marketing Performance Widget */
.performance-widget {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.performance-widget.active {
    opacity: 1;
    transform: scale(1);
}

.performance-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.performance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem;
    background: rgba(29, 12, 70, 0.1);
    border-radius: 4px;
}

.performance-label {
    font-size: 0.5rem;
    color: #1d0c46;
    opacity: 0.8;
}

.performance-value {
    font-size: 0.6rem;
    font-weight: 600;
    color: #1d0c46;
}

.performance-trend {
    font-size: 0.4rem;
    color: #1d0c46;
    opacity: 0.6;
}

.bar-chart {
    display: flex;
    align-items: end;
    gap: 0.3rem;
    height: 50px;
    margin-top: 0.5rem;
}

.bar {
    flex: 1;
    background: linear-gradient(to top, #1d0c46, #6b5b7a);
    border-radius: 3px 3px 0 0;
    animation: barGrow 1.5s ease-out 0.8s forwards;
    transform-origin: bottom;
    height: 0;
}

.bar:nth-child(1) { animation-delay: 0.8s; }
.bar:nth-child(2) { animation-delay: 1s; }
.bar:nth-child(3) { animation-delay: 1.2s; }
.bar:nth-child(4) { animation-delay: 1.4s; }

@keyframes barGrow {
    0% { height: 0; }
    100% { height: var(--bar-height, 70%); }
}

/* Conversion Funnel Widget */
.funnel-widget {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.funnel-widget.active {
    opacity: 1;
    transform: scale(1);
}

.funnel-steps {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.funnel-step {
    background: linear-gradient(90deg, #1d0c46, #6b5b7a);
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    text-align: center;
    position: relative;
    animation: funnelSlide 0.6s ease-out forwards;
    opacity: 0;
    transform: translateX(-20px);
}

.funnel-step:nth-child(1) { animation-delay: 0.2s; }
.funnel-step:nth-child(2) { animation-delay: 0.4s; }
.funnel-step:nth-child(3) { animation-delay: 0.6s; }
.funnel-step:nth-child(4) { animation-delay: 0.8s; }

@keyframes funnelSlide {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* ROI Tracker Widget */
.roi-widget {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.roi-widget.active {
    opacity: 1;
    transform: scale(1);
}

.roi-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1d0c46;
    text-align: center;
    margin: 0.5rem 0;
}

/* User Journey Widget */
.journey-widget {
    grid-column: span 3;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.journey-widget.active {
    opacity: 1;
    transform: scale(1);
}

.journey-map {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(29, 12, 70, 0.1);
    border-radius: 6px;
}

.journey-step {
    flex: 1;
    text-align: center;
    padding: 0.3rem;
    background: rgba(29, 12, 70, 0.2);
    border-radius: 4px;
    font-size: 0.6rem;
    color: #1d0c46;
    position: relative;
}

.journey-step::after {
    content: '→';
    position: absolute;
    right: -0.4rem;
    top: 50%;
    transform: translateY(-50%);
    color: #1d0c46;
    font-weight: bold;
}

.journey-step:last-child::after {
    display: none;
}

/* Feature Adoption Widget */
.adoption-widget {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.adoption-widget.active {
    opacity: 1;
    transform: scale(1);
}

.adoption-bar {
    width: 100%;
    height: 8px;
    background: rgba(29, 12, 70, 0.2);
    border-radius: 4px;
    margin: 0.3rem 0;
    overflow: hidden;
}

.adoption-fill {
    height: 100%;
    background: linear-gradient(90deg, #1d0c46, #6b5b7a);
    border-radius: 4px;
    width: 0;
    animation: adoptionFill 2s ease-out 1s forwards;
}

@keyframes adoptionFill {
    0% { width: 0; }
    100% { width: 85%; }
}

/* Retention Widget */
.retention-widget {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.retention-widget.active {
    opacity: 1;
    transform: scale(1);
}

.retention-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.retention-cell {
    aspect-ratio: 1;
    background: rgba(29, 12, 70, 0.3);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    color: #1d0c46;
    font-weight: 600;
    animation: retentionFade 0.5s ease-out forwards;
    opacity: 0;
}

.retention-cell:nth-child(1) { animation-delay: 0.2s; }
.retention-cell:nth-child(2) { animation-delay: 0.4s; }
.retention-cell:nth-child(3) { animation-delay: 0.6s; }
.retention-cell:nth-child(4) { animation-delay: 0.8s; }
.retention-cell:nth-child(5) { animation-delay: 1s; }
.retention-cell:nth-child(6) { animation-delay: 1.2s; }
.retention-cell:nth-child(7) { animation-delay: 1.4s; }
.retention-cell:nth-child(8) { animation-delay: 1.6s; }

@keyframes retentionFade {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .customizable-dashboard {
        height: 280px;
        padding: 0.8rem;
    }
    
    .dashboard-container {
        gap: 0.6rem;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .team-label {
        font-size: 0.7rem;
    }
    
    .dashboard-widget {
        padding: 0.6rem;
    }
    
    .widget-title {
        font-size: 0.6rem;
    }
    
    .kpi-value {
        font-size: 1.2rem;
    }
    
    .kpi-label {
        font-size: 0.5rem;
    }
    
    .pie-chart {
        width: 60px;
        height: 60px;
    }
    
    .chart-line {
        height: 40px;
    }
    
    .performance-metrics {
        gap: 0.2rem;
    }
    
    .performance-item {
        padding: 0.2rem;
    }
    
    .performance-label {
        font-size: 0.45rem;
    }
    
    .performance-value {
        font-size: 0.55rem;
    }
    
    .performance-trend {
        font-size: 0.35rem;
    }
}

@media (max-width: 480px) {
    .customizable-dashboard {
        height: 240px;
        padding: 0.6rem;
    }
    
    .dashboard-container {
        gap: 0.4rem;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .team-label {
        font-size: 0.6rem;
    }
    
    .dashboard-widget {
        padding: 0.4rem;
    }
    
    .widget-title {
        font-size: 0.5rem;
    }
    
    .kpi-value {
        font-size: 1rem;
    }
    
    .kpi-label {
        font-size: 0.45rem;
    }
    
    .pie-chart {
        width: 50px;
        height: 50px;
    }
    
    .chart-line {
        height: 30px;
    }
    
    .funnel-step {
        font-size: 0.5rem;
        padding: 0.3rem 0.6rem;
    }
    
    .journey-step {
        font-size: 0.5rem;
        padding: 0.2rem;
    }
    
    .performance-metrics {
        gap: 0.15rem;
    }
    
    .performance-item {
        padding: 0.15rem;
    }
    
    .performance-label {
        font-size: 0.4rem;
    }
    
    .performance-value {
        font-size: 0.5rem;
    }
    
    .performance-trend {
        font-size: 0.3rem;
    }
    
    .metrics-grid {
        gap: 0.2rem;
    }
    
    .metric-item {
        padding: 0.2rem;
    }
    
    .metric-value {
        font-size: 0.6rem;
    }
    
    .metric-label {
        font-size: 0.4rem;
    }
}

@media (max-width: 360px) {
    .customizable-dashboard {
        height: 220px;
        padding: 0.5rem;
    }
    
    .dashboard-container {
        gap: 0.3rem;
        grid-template-columns: 1fr;
    }
    
    .team-label {
        font-size: 0.55rem;
    }
    
    .dashboard-widget {
        padding: 0.3rem;
    }
    
    .widget-title {
        font-size: 0.45rem;
    }
    
    .kpi-value {
        font-size: 0.9rem;
    }
    
    .kpi-label {
        font-size: 0.4rem;
    }
    
    .pie-chart {
        width: 40px;
        height: 40px;
    }
    
    .chart-line {
        height: 25px;
    }
    
    .funnel-step {
        font-size: 0.45rem;
        padding: 0.2rem 0.4rem;
    }
    
    .journey-step {
        font-size: 0.45rem;
        padding: 0.15rem;
    }
    
    .performance-metrics {
        gap: 0.1rem;
    }
    
    .performance-item {
        padding: 0.1rem;
    }
    
    .performance-label {
        font-size: 0.35rem;
    }
    
    .performance-value {
        font-size: 0.45rem;
    }
    
    .performance-trend {
        font-size: 0.25rem;
    }
    
    .metrics-grid {
        gap: 0.15rem;
    }
    
    .metric-item {
        padding: 0.15rem;
    }
    
    .metric-value {
        font-size: 0.55rem;
    }
    
    .metric-label {
        font-size: 0.35rem;
    }
}