/* Custom CSS Framework - Replacement for Tailwind CSS */
/* Use these classes instead of Tailwind in all views */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

/* Global Font Application */
body, 
input, 
textarea, 
select, 
button {
    font-family: var(--font-primary, 'Manrope', sans-serif);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary, 'Manrope', sans-serif);
    color: var(--primary-900, #111827);
}

/* Global Color Classes */
.text-primary { color: var(--primary-500); }
.text-primary-light { color: var(--primary-300); }
.text-primary-dark { color: var(--primary-700); }
.text-secondary { color: var(--secondary-500); }
.text-secondary-light { color: var(--secondary-300); }
.text-secondary-dark { color: var(--secondary-700); }

.bg-primary { background-color: var(--primary-500); }
.bg-primary-light { background-color: var(--primary-100); }
.bg-primary-dark { background-color: var(--primary-700); }
.bg-secondary { background-color: var(--secondary-500); }
.bg-secondary-light { background-color: var(--secondary-100); }
.bg-secondary-dark { background-color: var(--secondary-700); }

.border-primary { border-color: var(--primary-500); }
.border-primary-light { border-color: var(--primary-200); }
.border-secondary { border-color: var(--secondary-500); }
.border-secondary-light { border-color: var(--secondary-200); }

/* Layout Classes */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.flex {
    display: flex;
}

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

.flex-row {
    flex-direction: row;
}

.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-end {
    justify-content: flex-end;
}

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

.flex-1 {
    flex: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

/* Grid System */
.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-4 {
    grid-template-columns: repeat(4, 1fr);
}

.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

.col-span-4 {
    grid-column: span 4;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

/* Spacing */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }

.m-0 { margin: 0; }
.m-2 { margin: 0.5rem; }
.m-4 { margin: 1rem; }
.m-6 { margin: 1.5rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }

.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }

/* Width & Height */
.w-full { width: 100%; }
.w-4 { width: 1rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }

.h-full { height: 100%; }
.h-4 { height: 1rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }

.min-h-120 { min-height: 120px; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

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

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

/* Colors */
.text-white { color: #ffffff; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }

.text-green-600 { color: #059669; }
.text-red-600 { color: #dc2626; }
.text-blue-600 { color: #2563eb; }
.text-purple-600 { color: #7c3aed; }
.text-amber-600 { color: #d97706; }

.text-green-200 { color: #bbf7d0; }
.text-red-200 { color: #fecaca; }
.text-amber-700 { color: #92400e; }
.text-amber-800 { color: #78350f; }

/* Background Colors */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }

.bg-green-50 { background-color: #f0fdf4; }
.bg-red-50 { background-color: #fef2f2; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-purple-50 { background-color: #faf5ff; }
.bg-amber-50 { background-color: #fffbeb; }

.bg-green-100 { background-color: #dcfce7; }
.bg-amber-100 { background-color: #fef3c7; }

/* Border */
.border { border: 1px solid #e5e7eb; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-amber-200 { border-color: #fde68a; }

/* Border Radius */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* Shadows */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }

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

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.hidden { display: none; }

/* Opacity */
.opacity-10 { opacity: 0.1; }
.opacity-80 { opacity: 0.8; }

/* Z-Index */
.z-10 { z-index: 10; }

/* Transitions */
.transition-all { transition: all 0.3s ease; }

/* Focus */
.focus-outline-none:focus { outline: none; }
.focus-ring-2:focus { box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.5); }
.focus-ring-offset-2:focus { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(124, 58, 237, 0.5); }

/* Hover Effects */
.hover-bg-gray-50:hover { background-color: #f9fafb; }

/* Responsive Design */
@media (min-width: 640px) {
    .sm-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .sm-hidden { display: none; }
    .sm-block { display: block; }
    .sm-flex { display: flex; }
}

@media (min-width: 768px) {
    .md-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md-hidden { display: none; }
    .md-block { display: block; }
    .md-flex { display: flex; }
}

@media (min-width: 1024px) {
    .lg-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .lg-hidden { display: none; }
    .lg-block { display: block; }
    .lg-flex { display: flex; }
}

/* Additional Responsive Utilities */
@media (max-width: 767px) {
    .mobile-hidden { display: none; }
    .mobile-block { display: block; }
    .mobile-flex { display: flex; }
}

/* Spacing Utilities */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }

/* Padding Utilities */
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

/* Height Utilities */
.h-full { height: 100%; }
.min-h-120 { min-height: 120px; }

/* Custom Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--font-primary, 'Manrope', sans-serif);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--secondary-500) 100%);
    color: white;
    border-color: var(--primary-500);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--secondary-600) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-200);
}

.btn-secondary {
    background: white;
    color: var(--primary-700, #374151);
    border-color: var(--primary-200, #d1d5db);
}

.btn-secondary:hover {
    background: var(--primary-50, #f9fafb);
    border-color: var(--primary-300, #9ca3af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-100);
}

/* Custom Card Styles */
.card {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid var(--primary-100, #e5e7eb);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 6px -1px var(--primary-200), 0 2px 4px -1px var(--primary-100);
    transform: translateY(-1px);
    border-color: var(--primary-200);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-900, #111827);
    margin: 0;
    font-family: var(--font-primary, 'Manrope', sans-serif);
}

.card-subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-700, #111827);
    margin: 0 0 1rem 0;
    font-family: var(--font-primary, 'Manrope', sans-serif);
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-danger {
    background-color: #fecaca;
    color: #991b1b;
}

.badge-warning {
    background-color: var(--secondary-100, #fef3c7);
    color: var(--secondary-800, #92400e);
}

.badge-info {
    background-color: var(--primary-100, #dbeafe);
    color: var(--primary-700, #1e40af);
}

.badge-primary {
    background-color: var(--primary-100);
    color: var(--primary-700);
}

.badge-secondary {
    background-color: var(--secondary-100);
    color: var(--secondary-700);
}

.badge-gray {
    background-color: #f3f4f6;
    color: #374151;
}

/* Icon Styles */
.icon {
    width: 1rem;
    height: 1rem;
}

.icon-sm {
    width: 0.875rem;
    height: 0.875rem;
}

.icon-lg {
    width: 1.25rem;
    height: 1.25rem;
}

.icon-xl {
    width: 1.5rem;
    height: 1.5rem;
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--primary-200, #d1d5db);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
    font-family: var(--font-primary, 'Manrope', sans-serif);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-warning {
    background: linear-gradient(135deg, var(--secondary-100) 0%, var(--secondary-200) 100%);
    border: 1px solid var(--secondary-500);
    color: var(--secondary-800);
}

.alert-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1px solid #10b981;
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    border: 1px solid #ef4444;
    color: #991b1b;
}

.alert-primary {
    background: linear-gradient(135deg, var(--primary-100) 0%, var(--primary-200) 100%);
    border: 1px solid var(--primary-500);
    color: var(--primary-800);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.whitespace-nowrap { white-space: nowrap; }
.pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }

/* Navigation Styles */
.nav-link {
    color: var(--primary-600, #4b5563);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: var(--font-primary, 'Manrope', sans-serif);
}

.nav-link:hover {
    color: var(--primary-500);
}

.nav-link.active {
    color: var(--primary-600);
    font-weight: 600;
}

/* Link Styles */
a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Search Bar Styles */
.search-bar {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--primary-200, #e5e7eb);
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    font-family: var(--font-primary, 'Manrope', sans-serif);
}

.search-bar:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.search-bar::placeholder {
    color: var(--primary-400, #9ca3af);
}

/* Print Styles */
@media print {
    .no-print { display: none !important; }
    .card { box-shadow: none; border: 1px solid var(--primary-200, #d1d5db); }
}
