/**
 * Modern Customer End Design System
 * Startup-style, intuitive design
 */

/* Reset spacing for customer pages */
body.customer-page,
html.customer-page {
    margin: 0;
    padding: 0;
}

body.customer-page {
    overflow-x: hidden;
}

:root {
    --customer-primary: #0a3bff;
    --customer-primary-hover: #0830cc;
    --customer-primary-light: #3b82f6;
    --customer-primary-soft: rgba(10, 59, 255, 0.08);
    --customer-success: #10b981;
    --customer-warning: #f59e0b;
    --customer-error: #ef4444;
    --customer-bg: #ffffff;
    --customer-bg-soft: #f8fafc;
    --customer-bg-elevated: #ffffff;
    --customer-border: #e2e8f0;
    --customer-text: #0f172a;
    --customer-text-secondary: #64748b;
    --customer-text-muted: #94a3b8;
    --customer-sidebar-width: 280px;
    --customer-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --customer-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --customer-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --customer-radius-sm: 8px;
    --customer-radius-md: 12px;
    --customer-radius-lg: 16px;
}

/* Modern Card */
.customer-card-modern {
    background: var(--customer-bg-elevated);
    border: 1px solid var(--customer-border);
    border-radius: var(--customer-radius-lg);
    padding: 16px;
    box-shadow: var(--customer-shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.customer-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--customer-primary), var(--customer-primary-light));
    opacity: 0;
    transition: opacity 0.3s;
}

.customer-card-modern:hover {
    box-shadow: var(--customer-shadow-md);
    border-color: var(--customer-primary-light);
    transform: translateY(-2px);
}

.customer-card-modern:hover::before {
    opacity: 1;
}

/* Stat Card */
.customer-stat-modern {
    background: linear-gradient(135deg, var(--customer-primary) 0%, var(--customer-primary-light) 100%);
    border-radius: var(--customer-radius-lg);
    padding: 16px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(10, 59, 255, 0.2);
}

.customer-stat-modern::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: statGlow 8s ease-in-out infinite;
}

@keyframes statGlow {
    0%, 100% { transform: translate(0,0) rotate(0deg); }
    50% { transform: translate(10px,10px) rotate(180deg); }
}

.customer-stat-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
    letter-spacing: -0.01em;
}

.customer-stat-label {
    font-size: 14px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

/* Modern Button */
.customer-btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--customer-radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.customer-btn-modern-primary {
    background: var(--customer-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(10, 59, 255, 0.2);
}

.customer-btn-modern-primary:hover {
    background: var(--customer-primary-hover);
    box-shadow: 0 4px 12px rgba(10, 59, 255, 0.3);
    transform: translateY(-1px);
}

.customer-btn-modern-secondary {
    background: var(--customer-bg-soft);
    color: var(--customer-text);
    border: 1px solid var(--customer-border);
}

.customer-btn-modern-secondary:hover {
    background: var(--customer-bg);
    border-color: var(--customer-primary-light);
    transform: translateY(-1px);
}

/* Badge */
.customer-badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.customer-badge-modern-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--customer-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.customer-badge-modern-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--customer-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.customer-badge-modern-primary {
    background: var(--customer-primary-soft);
    color: var(--customer-primary);
    border: 1px solid rgba(10, 59, 255, 0.2);
}

/* Progress Bar */
.customer-progress-modern {
    width: 100%;
    height: 8px;
    background: var(--customer-bg-soft);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.customer-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--customer-primary), var(--customer-primary-light));
    border-radius: 9999px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(10, 59, 255, 0.3);
}

/* Empty State */
.customer-empty-modern {
    text-align: center;
    padding: 48px 24px;
    color: var(--customer-text-secondary);
}

.customer-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--customer-bg-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--customer-text-muted);
    font-size: 24px;
}

/* Grid */
.customer-grid-modern {
    display: grid;
    gap: 24px;
}

.customer-grid-2 { grid-template-columns: repeat(2, 1fr); }
.customer-grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1024px) {
    .customer-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .customer-grid-2,
    .customer-grid-3 { grid-template-columns: 1fr; }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.customer-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Page Header */
.customer-page-header-modern {
    margin-bottom: 32px;
}

.customer-page-title-modern {
    font-size: 32px;
    font-weight: 700;
    color: var(--customer-text);
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.customer-page-subtitle-modern {
    font-size: 16px;
    color: var(--customer-text-secondary);
    margin: 0;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading States */
.customer-btn-modern:disabled,
.customer-btn-modern.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.customer-btn-modern.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse Animation for Important Elements */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.customer-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Hover Effects for Interactive Elements */
a.customer-btn-modern,
button.customer-btn-modern {
    position: relative;
    overflow: hidden;
}

a.customer-btn-modern::before,
button.customer-btn-modern::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;
}

a.customer-btn-modern:hover::before,
button.customer-btn-modern:hover::before {
    width: 300px;
    height: 300px;
}

/* Focus States for Accessibility */
.customer-btn-modern:focus-visible {
    outline: 3px solid var(--customer-primary);
    outline-offset: 2px;
}

.customer-card-modern:focus-within {
    box-shadow: var(--customer-shadow-md);
    border-color: var(--customer-primary-light);
}

/* Responsive */
@media (max-width: 768px) {
    .customer-page-title-modern { font-size: 24px; }
    .customer-stat-value { font-size: 28px; }
    .customer-card-modern { padding: 20px; }
    
    /* Better touch targets on mobile */
    .customer-btn-modern {
        min-height: 44px;
        padding: 12px 20px;
    }
}

