/**
 * AUTOCORE360 Admin Panel - Base Styles
 * Reset, typography, scrollbar, animations
 */

/* ============ BASE STYLES ============ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background-color: var(--background);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ============ TYPOGRAPHY HIERARCHY ============ */
.page-title {
    font-size: var(--text-xl, 1.25rem);
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: var(--text-sm, 0.875rem);
    color: var(--text-muted);
    font-weight: 400;
}

.section-title {
    font-size: var(--text-lg, 1.125rem);
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 1rem;
}

.card-title {
    font-size: var(--text-base, 1rem);
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.card-subtitle {
    font-size: var(--text-sm, 0.875rem);
    color: var(--text-muted);
    font-weight: 400;
}

/* Text utilities */
.text-xs { font-size: var(--text-xs, 0.75rem); }
.text-sm { font-size: var(--text-sm, 0.875rem); }
.text-base { font-size: var(--text-base, 1rem); }
.text-lg { font-size: var(--text-lg, 1.125rem); }
.text-xl { font-size: var(--text-xl, 1.25rem); }
.text-2xl { font-size: var(--text-2xl, 1.5rem); }
.text-3xl { font-size: var(--text-3xl, 1.875rem); }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }

/* ============ FOCUS INDICATORS (A11Y) ============ */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    z-index: 9999;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ============ CONTENT ANIMATIONS - MANDIAG STYLE ============ */

/* Fade in content animation */
@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply to main content area */
.content-area {
    animation: fadeInContent 0.5s ease forwards;
}

/* Page content sections */
.page-content {
    animation: fadeInContent 0.4s ease forwards;
}

/* Stats grid cards stagger animation */
.stats-grid .stat-card {
    opacity: 0;
    animation: fadeInContent 0.5s ease forwards;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0.1s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.15s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.2s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.25s; }
.stats-grid .stat-card:nth-child(5) { animation-delay: 0.3s; }
.stats-grid .stat-card:nth-child(6) { animation-delay: 0.35s; }

/* Cards stagger animation */
.card {
    opacity: 0;
    animation: fadeInContent 0.5s ease forwards;
    animation-delay: 0.2s;
}

/* Scale in animation for icons/badges */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pop animation for modal icons */
@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Slide up animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animation for notifications */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Spin animation for loaders */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Shimmer animation for skeleton loading */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .content-area,
    .page-content,
    .stats-grid .stat-card,
    .card {
        opacity: 1;
        animation: none;
    }
}
