/* ==========================================================================
   COMAFE IMPORT - PREMIUM DESIGN v4.0
   Desarrollado por Appyweb.es
   ========================================================================== */

/* Variables CSS */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Reset y Base */
.comafe-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    margin: -20px -20px -20px -2px;
    padding: 0;
    min-height: calc(100vh - 32px);
}

.comafe-wrap * {
    box-sizing: border-box;
}

/* Header Premium */
.comafe-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 2.5rem 3rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.comafe-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.comafe-header-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

.comafe-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.025em;
}

.comafe-header p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

/* Container */
.comafe-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 3rem;
}

/* Grid System */
.comafe-grid {
    display: grid;
    gap: 2rem;
}

.comafe-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.comafe-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.comafe-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Cards Premium */
.comafe-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.comafe-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.comafe-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.comafe-card:hover::before {
    transform: scaleX(1);
}

/* Card Header */
.comafe-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-tertiary);
}

.comafe-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.comafe-card-icon.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.comafe-card-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.comafe-card-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.comafe-card-icon.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.comafe-card-title {
    flex: 1;
}

.comafe-card-title h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.comafe-card-title p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Stats Cards */
.comafe-stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.comafe-stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.comafe-stat-icon {
    font-size: 2.5rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.comafe-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    line-height: 1;
}

.comafe-stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Buttons Premium */
.comafe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.comafe-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.comafe-btn:hover::before {
    width: 300px;
    height: 300px;
}

.comafe-btn span {
    position: relative;
    z-index: 1;
}

.comafe-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.comafe-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.comafe-btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.comafe-btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.comafe-btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.comafe-btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.comafe-btn-block {
    width: 100%;
}

/* Progress Bar Premium */
.comafe-progress-container {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    margin: 2rem 0;
}

.comafe-progress-header {
    text-align: center;
    margin-bottom: 2rem;
}

.comafe-progress-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.comafe-progress-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 0;
}

.comafe-progress-bar-wrapper {
    position: relative;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin: 2rem 0;
    box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.06);
}

.comafe-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-xl);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.comafe-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.comafe-progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* Stats Grid */
.comafe-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.comafe-stat-box {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.comafe-stat-box:hover {
    background: var(--bg-primary);
    box-shadow: var(--shadow);
}

.comafe-stat-box-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.comafe-stat-box-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* Table Premium */
.comafe-table-wrapper {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.comafe-table {
    width: 100%;
    border-collapse: collapse;
}

.comafe-table thead {
    background: var(--bg-tertiary);
}

.comafe-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.comafe-table td {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-primary);
}

.comafe-table tbody tr {
    transition: background-color 0.2s ease;
}

.comafe-table tbody tr:hover {
    background: var(--bg-secondary);
}

/* Badge */
.comafe-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comafe-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.comafe-badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.comafe-badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.comafe-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Alert */
.comafe-alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin: 1rem 0;
    display: flex;
    align-items: start;
    gap: 1rem;
}

.comafe-alert-success {
    background: #d1fae5;
    border-left: 4px solid var(--success);
    color: #065f46;
}

.comafe-alert-error {
    background: #fee2e2;
    border-left: 4px solid var(--danger);
    color: #991b1b;
}

.comafe-alert-info {
    background: #dbeafe;
    border-left: 4px solid var(--info);
    color: #1e40af;
}

/* Loading */
.comafe-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .comafe-container {
        padding: 1.5rem 2rem;
    }
    
    .comafe-header {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .comafe-container {
        padding: 1rem;
    }
    
    .comafe-header {
        padding: 1.5rem;
    }
    
    .comafe-header h1 {
        font-size: 1.75rem;
    }
    
    .comafe-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
