/* Premium Modern Design System */

/* Import premium fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Design tokens */
:root {
    /* Colors - Minimal palette */
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;
    --black: #000000;
    
    /* Brand colors - Subtle */
    --brand-primary: #2563eb;
    --brand-hover: #1d4ed8;
    --brand-light: #eff6ff;
    
    /* Semantic colors */
    --success: #00c851;
    --warning: #ff8800;
    --danger: #ff3b30;
    
    /* Shadows - Subtle depth */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Reset and base */
* {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Premium Button Design */
.btn {
    @apply inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-all duration-200;
    height: 40px;
    padding: 0 20px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-xs);
    gap: 6px; /* Space between icon and text */
    align-items: center;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary {
    background: var(--brand-primary);
    color: var(--white);
    font-weight: 500;
}

.btn-primary:hover {
    background: var(--brand-hover);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-200);
    box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

.btn-destructive {
    background: var(--danger);
    color: var(--white);
}

.btn-destructive:hover {
    background: #e60000;
}

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    box-shadow: none;
    border: none;
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.btn-sm {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
    gap: 6px;
}

.btn-lg {
    height: 48px;
    padding: 0 32px;
    font-size: 16px;
}

/* Clean Input Design */
.input {
    @apply w-full transition-all duration-200;
    height: 44px;
    padding: 0 16px;
    background: var(--white);
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    font-size: 15px;
    color: var(--gray-900);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05), inset 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

.input:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: var(--white);
}

.input::placeholder {
    color: var(--gray-400);
}

/* Select styling */
select.input {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3e%3cpath d='M4 6L8 10L12 6' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

textarea.input {
    height: auto;
    min-height: 100px;
    padding: 12px 16px;
    resize: vertical;
}

/* Labels */
.label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.label.required::after {
    content: " *";
    color: var(--danger);
}

/* Card Design - Clean and minimal */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Badges - Minimal style */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.badge-primary {
    background: var(--brand-light);
    color: var(--brand-primary);
}

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

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-warning {
    background: #fff3e0;
    color: #ef6c00;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

/* Table Design */
.table-auto th {
    @apply text-left text-xs font-semibold uppercase tracking-wider;
    padding: 12px 16px;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.table-auto td {
    padding: 16px;
    color: var(--gray-900);
    border-bottom: 1px solid var(--gray-100);
}

.table-auto tbody tr:hover {
    background: var(--gray-50);
}

/* Form sections */
.form-group {
    margin-bottom: 20px;
}

.form-section {
    padding: 24px;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

/* Status indicators */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.active {
    background: var(--success);
}

.status-dot.inactive {
    background: var(--danger);
}

.status-dot.pending {
    background: var(--warning);
}

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

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

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

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

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-radius: 50%;
    border-top-color: var(--brand-primary);
    animation: spin 0.8s linear infinite;
}

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

/* Validation states */
.input.error {
    border-color: var(--danger);
    background: #fffafa;
}

.input.error:focus {
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1);
}

.input.success {
    border-color: var(--success);
    background: #f0fff4;
}

.input.success:focus {
    box-shadow: 0 0 0 3px rgba(0, 200, 81, 0.1);
}

/* Required fields highlight */
.input:required:placeholder-shown {
    border-color: var(--gray-400);
    background: #fffef7;
}

/* Focus visible for accessibility */
.btn:focus-visible,
.input:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Animations - Subtle */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive */
@media (max-width: 640px) {
    .btn {
        height: 36px;
        padding: 0 16px;
        font-size: 14px;
    }
    
    .input {
        height: 36px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .card {
        border-radius: 6px;
    }
}

/* Utility classes */
.text-mono {
    font-family: var(--font-mono);
}

.divider {
    height: 1px;
    background: var(--gray-200);
    margin: 24px 0;
}

/* Premium hover states */
a:not(.btn) {
    color: var(--brand-primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:not(.btn):hover {
    opacity: 0.8;
}

/* Clean focus states */
*:focus {
    outline: none;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    .input {
        border-width: 2px;
    }
    
    .btn {
        font-weight: 600;
    }
}

/* Modern Add Button - Inspired by cssbuttons.io */
.modern-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.modern-add-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.modern-add-btn:hover::before {
    left: 100%;
}

.modern-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.modern-add-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.modern-add-btn i {
    transition: transform 0.3s ease;
}

.modern-add-btn:hover i {
    transform: rotate(90deg);
}

/* Dark mode ready */
@media (prefers-color-scheme: dark) {
    /* Add dark mode variables here if needed */
}