/* public/css/dashboard-unified.css */
/* Sistema de diseño unificado para todos los dashboards */

/* ===================================
   VARIABLES CSS - PALETA DE COLORES
   =================================== */

:root {
    /* Colores primarios - Indigo como base */
    --dash-primary: 99 102 241;      /* indigo-500 */
    --dash-primary-light: 129 140 248; /* indigo-400 */
    --dash-primary-dark: 79 70 229;   /* indigo-600 */
    
    /* Colores secundarios */
    --dash-purple: 139 92 246;
    --dash-blue: 59 130 246;
    --dash-cyan: 6 182 212;
    --dash-emerald: 16 185 129;
    --dash-amber: 245 158 11;
    --dash-rose: 244 63 94;
    
    /* Gradientes de rol */
    --gradient-empresa: linear-gradient(135deg, rgb(99 102 241), rgb(139 92 246));
    --gradient-team: linear-gradient(135deg, rgb(16 185 129), rgb(6 182 212));
    --gradient-cliente: linear-gradient(135deg, rgb(59 130 246), rgb(99 102 241));
    --gradient-superadmin: linear-gradient(135deg, rgb(139 92 246), rgb(244 63 94));
    
    /* Sombras */
    --dash-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --dash-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --dash-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --dash-shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    
    /* Timing */
    --dash-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --dash-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===================================
   COMPONENTES BASE
   =================================== */

/* Stats Cards */
.dash-stat-card {
    background: white;
    border-radius: 1.25rem;
    padding: 1.25rem;
    border: 1px solid rgba(229, 231, 235, 0.8);
    transition: all 0.3s var(--dash-ease);
    position: relative;
    overflow: hidden;
}

.dash-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-empresa);
    opacity: 0;
    transition: opacity 0.3s var(--dash-ease);
}

.dash-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--dash-shadow-lg);
}

.dash-stat-card:hover::before {
    opacity: 1;
}

.dark .dash-stat-card {
    background: rgb(31 41 55);
    border-color: rgba(75, 85, 99, 0.5);
}

/* Stat Icon Container */
.dash-stat-icon {
    padding: 0.625rem;
    border-radius: 0.75rem;
    display: inline-flex;
    transition: transform 0.3s var(--dash-bounce);
}

.dash-stat-card:hover .dash-stat-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Color Variants for Icons */
.dash-icon-indigo { background: rgba(99, 102, 241, 0.1); color: rgb(99 102 241); }
.dash-icon-purple { background: rgba(139, 92, 246, 0.1); color: rgb(139 92 246); }
.dash-icon-blue { background: rgba(59, 130, 246, 0.1); color: rgb(59 130 246); }
.dash-icon-emerald { background: rgba(16, 185, 129, 0.1); color: rgb(16 185 129); }
.dash-icon-amber { background: rgba(245, 158, 11, 0.1); color: rgb(245 158 11); }
.dash-icon-rose { background: rgba(244, 63, 94, 0.1); color: rgb(244 63 94); }

.dark .dash-icon-indigo { background: rgba(99, 102, 241, 0.2); }
.dark .dash-icon-purple { background: rgba(139, 92, 246, 0.2); }
.dark .dash-icon-blue { background: rgba(59, 130, 246, 0.2); }
.dark .dash-icon-emerald { background: rgba(16, 185, 129, 0.2); }
.dark .dash-icon-amber { background: rgba(245, 158, 11, 0.2); }
.dark .dash-icon-rose { background: rgba(244, 63, 94, 0.2); }

/* ===================================
   WELCOME BANNERS
   =================================== */

.dash-welcome-banner {
    position: relative;
    border-radius: 1.5rem;
    padding: 1.5rem 2rem;
    color: white;
    overflow: hidden;
    box-shadow: var(--dash-shadow-lg);
}

.dash-welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(40px);
    animation: float-slow 6s ease-in-out infinite;
}

.dash-welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    filter: blur(30px);
    animation: float-slow 8s ease-in-out infinite reverse;
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* Banner variants by role */
.dash-banner-empresa { background: var(--gradient-empresa); }
.dash-banner-team { background: var(--gradient-team); }
.dash-banner-cliente { background: var(--gradient-cliente); }
.dash-banner-superadmin { background: var(--gradient-superadmin); }

/* ===================================
   WIDGET CARDS
   =================================== */

.dash-widget {
    background: white;
    border-radius: 1.25rem;
    border: 1px solid rgba(229, 231, 235, 0.8);
    overflow: hidden;
    transition: box-shadow 0.3s var(--dash-ease);
}

.dash-widget:hover {
    box-shadow: var(--dash-shadow-glow);
}

.dark .dash-widget {
    background: rgb(31 41 55);
    border-color: rgba(75, 85, 99, 0.5);
}

.dash-widget-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dark .dash-widget-header {
    border-color: rgba(75, 85, 99, 0.5);
}

.dash-widget-body {
    padding: 1rem;
    max-height: 280px;
    overflow-y: auto;
}

/* Custom scrollbar for widgets */
.dash-widget-body::-webkit-scrollbar {
    width: 4px;
}

.dash-widget-body::-webkit-scrollbar-track {
    background: transparent;
}

.dash-widget-body::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 4px;
}

.dash-widget-body::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.8);
}

/* ===================================
   LIST ITEMS
   =================================== */

.dash-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    transition: all 0.2s var(--dash-ease);
    cursor: pointer;
}

.dash-list-item:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(4px);
}

.dark .dash-list-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* ===================================
   DATE BADGES (for events/calendar)
   =================================== */

.dash-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.2s var(--dash-ease);
}

.dash-list-item:hover .dash-date-badge {
    transform: scale(1.1);
}

/* ===================================
   TASK CHECKBOX
   =================================== */

.dash-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid rgb(209 213 219);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--dash-ease);
    cursor: pointer;
    flex-shrink: 0;
}

.dash-checkbox:hover {
    border-color: rgb(99 102 241);
    background: rgba(99, 102, 241, 0.1);
}

.dash-checkbox.completed {
    background: rgb(16 185 129);
    border-color: rgb(16 185 129);
}

.dash-checkbox svg {
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s var(--dash-bounce);
}

.dash-checkbox:hover svg,
.dash-checkbox.completed svg {
    opacity: 1;
    transform: scale(1);
}

/* ===================================
   PROGRESS BARS
   =================================== */

.dash-progress {
    height: 0.5rem;
    background: rgba(229, 231, 235, 0.8);
    border-radius: 9999px;
    overflow: hidden;
}

.dark .dash-progress {
    background: rgba(75, 85, 99, 0.5);
}

.dash-progress-bar {
    height: 100%;
    background: var(--gradient-empresa);
    border-radius: 9999px;
    transition: width 0.5s var(--dash-ease);
    position: relative;
}

.dash-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===================================
   BADGES / TAGS
   =================================== */

.dash-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: transform 0.2s var(--dash-ease);
}

.dash-badge:hover {
    transform: scale(1.05);
}

.dash-badge-indigo { background: rgba(99, 102, 241, 0.1); color: rgb(99 102 241); }
.dash-badge-emerald { background: rgba(16, 185, 129, 0.1); color: rgb(16 185 129); }
.dash-badge-amber { background: rgba(245, 158, 11, 0.1); color: rgb(245 158 11); }
.dash-badge-rose { background: rgba(244, 63, 94, 0.1); color: rgb(244 63 94); }

/* ===================================
   EMPTY STATES
   =================================== */

.dash-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: rgb(156 163 175);
}

.dash-empty svg {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.75rem;
    opacity: 0.5;
}

.dash-empty p {
    font-size: 0.875rem;
}

.dash-empty a {
    color: rgb(99 102 241);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: inline-block;
}

.dash-empty a:hover {
    text-decoration: underline;
}

/* ===================================
   ANIMATIONS
   =================================== */

/* Fade in up animation for cards */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dash-animate-in {
    animation: fade-in-up 0.4s var(--dash-ease) forwards;
}

.dash-animate-in:nth-child(1) { animation-delay: 0ms; }
.dash-animate-in:nth-child(2) { animation-delay: 50ms; }
.dash-animate-in:nth-child(3) { animation-delay: 100ms; }
.dash-animate-in:nth-child(4) { animation-delay: 150ms; }
.dash-animate-in:nth-child(5) { animation-delay: 200ms; }
.dash-animate-in:nth-child(6) { animation-delay: 250ms; }

/* Pulse animation for urgent items */
@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.dash-pulse {
    animation: pulse-soft 2s ease-in-out infinite;
}

/* Hover glow effect */
.dash-glow {
    transition: box-shadow 0.3s var(--dash-ease);
}

.dash-glow:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

/* ===================================
   TABLES
   =================================== */

.dash-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

.dash-table thead tr {
    background: rgba(249, 250, 251, 0.8);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgb(107 114 128);
}

.dark .dash-table thead tr {
    background: rgba(55, 65, 81, 0.5);
    color: rgb(156 163 175);
}

.dash-table th {
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.dash-table tbody tr {
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    transition: background 0.2s var(--dash-ease);
}

.dark .dash-table tbody tr {
    border-color: rgba(75, 85, 99, 0.3);
}

.dash-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

.dark .dash-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

.dash-table td {
    padding: 1rem 1.5rem;
}

/* Avatar in tables */
.dash-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
    background: var(--gradient-empresa);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s var(--dash-ease);
}

tr:hover .dash-avatar {
    transform: scale(1.1);
}

/* ===================================
   QUICK ACTIONS BUTTONS
   =================================== */

.dash-action-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: rgb(156 163 175);
    transition: all 0.2s var(--dash-ease);
}

.dash-action-btn:hover {
    color: rgb(99 102 241);
    background: rgba(99, 102, 241, 0.1);
}

.dash-action-btn.danger:hover {
    color: rgb(244 63 94);
    background: rgba(244, 63, 94, 0.1);
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   =================================== */

@media (max-width: 768px) {
    .dash-welcome-banner {
        padding: 1.25rem 1.5rem;
        border-radius: 1rem;
    }
    
    .dash-stat-card {
        padding: 1rem;
    }
    
    .dash-widget-header {
        padding: 1rem;
    }
    
    .dash-widget-body {
        padding: 0.75rem;
    }
}
