/* public/css/base.css */
/* SlamPy Invoices - Base Styles, Reset & Typography */

/* === CSS RESET === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    transition: color var(--animation-duration-normal) ease;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: transparent !important;
    overflow-x: hidden;
    min-height: 100vh;
    transition: color var(--animation-duration-normal) ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remove default list styles */
ul,
ol {
    list-style: none;
}

/* Remove default link styles */
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--animation-duration-normal) ease;
}

a:hover {
    color: var(--accent-primary);
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Remove default button styles */
button {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
    outline: none;
}

/* Form elements reset */
input,
textarea,
select {
    font: inherit;
    outline: none;
    border: none;
    background: none;
}

/* Table reset */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* === ANIMATED BACKGROUND === */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    transition: background var(--animation-duration-normal) ease;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 107, 157, 0.1) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
    transition: background var(--animation-duration-normal) ease;
}

[data-theme="light"] .bg-animation::before {
    background: 
        radial-gradient(circle at 20% 80%, rgba(74, 0, 224, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(142, 45, 226, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(201, 102, 255, 0.05) 0%, transparent 50%);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: var(--text-primary);
    transition: color var(--animation-duration-normal) ease;
}

h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 600;
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 600;
}

h4 {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 600;
}

h5 {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    font-weight: 500;
}

h6 {
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    font-weight: 500;
}

p {
    margin: 0;
    line-height: 1.7;
    color: var(--text-secondary);
    transition: color var(--animation-duration-normal) ease;
}

/* Text utilities */
.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-tertiary {
    color: var(--text-tertiary);
}

.text-muted {
    color: var(--text-muted);
}

.text-accent {
    color: var(--accent-primary);
}

.text-success {
    color: var(--success-text);
}

.text-error {
    color: var(--error-text);
}

.text-warning {
    color: var(--warning-text);
}

.text-info {
    color: var(--info-text);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-weight-light {
    font-weight: 300;
}

.font-weight-normal {
    font-weight: 400;
}

.font-weight-medium {
    font-weight: 500;
}

.font-weight-semibold {
    font-weight: 600;
}

.font-weight-bold {
    font-weight: 700;
}

.font-size-sm {
    font-size: 0.85rem;
}

.font-size-base {
    font-size: 0.9rem;
}

.font-size-lg {
    font-size: 1.1rem;
}

.font-size-xl {
    font-size: 1.3rem;
}

/* === LAYOUT UTILITIES === */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.gap-4 {
    gap: 2rem;
}

.gap-5 {
    gap: 2.5rem;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-auto {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* === SPACING UTILITIES === */
.m-0 { margin: 0; }
.m-1 { margin: 0.5rem; }
.m-2 { margin: 1rem; }
.m-3 { margin: 1.5rem; }
.m-4 { margin: 2rem; }
.m-5 { margin: 2.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 2.5rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 2.5rem; }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: 0.5rem; }
.ml-2 { margin-left: 1rem; }
.ml-3 { margin-left: 1.5rem; }
.ml-4 { margin-left: 2rem; }
.ml-auto { margin-left: auto; }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: 0.5rem; }
.mr-2 { margin-right: 1rem; }
.mr-3 { margin-right: 1.5rem; }
.mr-4 { margin-right: 2rem; }
.mr-auto { margin-right: auto; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 2.5rem; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.5rem; }
.pt-2 { padding-top: 1rem; }
.pt-3 { padding-top: 1.5rem; }
.pt-4 { padding-top: 2rem; }
.pt-5 { padding-top: 2.5rem; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 1rem; }
.pb-3 { padding-bottom: 1.5rem; }
.pb-4 { padding-bottom: 2rem; }
.pb-5 { padding-bottom: 2.5rem; }

.pl-0 { padding-left: 0; }
.pl-1 { padding-left: 0.5rem; }
.pl-2 { padding-left: 1rem; }
.pl-3 { padding-left: 1.5rem; }
.pl-4 { padding-left: 2rem; }
.pl-5 { padding-left: 2.5rem; }

.pr-0 { padding-right: 0; }
.pr-1 { padding-right: 0.5rem; }
.pr-2 { padding-right: 1rem; }
.pr-3 { padding-right: 1.5rem; }
.pr-4 { padding-right: 2rem; }
.pr-5 { padding-right: 2.5rem; }

/* === VISIBILITY UTILITIES === */
.hidden {
    display: none;
}

.visible {
    visibility: visible;
    opacity: 1;
}

.invisible {
    visibility: hidden;
    opacity: 0;
}

.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* === POSITION UTILITIES === */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* === SIZE UTILITIES === */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }

.h-full { height: 100%; }
.h-auto { height: auto; }
.h-screen { height: 100vh; }

.min-h-screen { min-height: 100vh; }
.min-h-full { min-height: 100%; }

.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-full { max-width: 100%; }
.max-w-none { max-width: none; }

/* === BORDER UTILITIES === */
.border { border: 1px solid var(--border-primary); }
.border-t { border-top: 1px solid var(--border-primary); }
.border-r { border-right: 1px solid var(--border-primary); }
.border-b { border-bottom: 1px solid var(--border-primary); }
.border-l { border-left: 1px solid var(--border-primary); }

.border-accent { border-color: var(--border-accent); }
.border-transparent { border-color: transparent; }

.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: var(--border-radius-sm); }
.rounded { border-radius: var(--border-radius-md); }
.rounded-lg { border-radius: var(--border-radius-lg); }
.rounded-xl { border-radius: var(--border-radius-xl); }
.rounded-full { border-radius: var(--border-radius-full); }

/* === SHADOW UTILITIES === */
.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* === OVERFLOW UTILITIES === */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-hidden { overflow-y: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* === TRANSITION UTILITIES === */
.transition-none { transition: none; }
.transition-all { transition: all var(--animation-duration-normal) var(--animation-easing); }
.transition-colors { transition: color var(--animation-duration-normal) var(--animation-easing), background-color var(--animation-duration-normal) var(--animation-easing), border-color var(--animation-duration-normal) var(--animation-easing); }
.transition-opacity { transition: opacity var(--animation-duration-normal) var(--animation-easing); }
.transition-transform { transition: transform var(--animation-duration-normal) var(--animation-easing); }

/* === TRANSFORM UTILITIES === */
.transform { transform: translateZ(0); }
.scale-95 { transform: scale(0.95); }
.scale-100 { transform: scale(1); }
.scale-105 { transform: scale(1.05); }
.scale-110 { transform: scale(1.1); }

.translate-y-0 { transform: translateY(0); }
.translate-y-1 { transform: translateY(0.25rem); }
.translate-y-2 { transform: translateY(0.5rem); }
.translate-y-3 { transform: translateY(0.75rem); }
.-translate-y-1 { transform: translateY(-0.25rem); }
.-translate-y-2 { transform: translateY(-0.5rem); }
.-translate-y-3 { transform: translateY(-0.75rem); }

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

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--bg-tertiary);
}

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

::-webkit-scrollbar-corner {
    background: var(--bg-tertiary);
}

/* === SELECTION STYLES === */
::selection {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

::-moz-selection {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

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

/* === ACCESSIBILITY === */
.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;
}

/* === PRINT STYLES === */
@media print {
    .no-print {
        display: none !important;
    }
    
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        color: black !important;
    }
    
    p {
        orphans: 3;
        widows: 3;
    }
    
    a {
        color: black !important;
        text-decoration: underline;
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .bg-animation,
    .bg-animation::before {
        animation: none !important;
    }
}