/* Custom Styles for Google Sheets to PDF Converter */

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
    min-height: 100vh;
}

/* Fallback styles for when Tailwind doesn't load */
.bg-gray-50 { background-color: #f9fafb !important; }
.bg-white { background-color: #ffffff !important; }
.bg-blue-600 { background-color: #2563eb !important; }
.bg-blue-700 { background-color: #1d4ed8 !important; }
.bg-green-600 { background-color: #059669 !important; }
.bg-green-700 { background-color: #047857 !important; }
.bg-blue-100 { background-color: #dbeafe !important; }
.text-blue-800 { color: #1e40af !important; }
.text-blue-600 { color: #2563eb !important; }
.text-gray-900 { color: #111827 !important; }
.text-gray-700 { color: #374151 !important; }
.text-gray-600 { color: #4b5563 !important; }
.text-gray-500 { color: #6b7280 !important; }
.text-white { color: #ffffff !important; }
.text-green-600 { color: #059669 !important; }
.text-red-600 { color: #dc2626 !important; }

/* Layout utilities */
.min-h-screen { min-height: 100vh !important; }
.max-w-7xl { max-width: 80rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-8 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
.p-6 { padding: 1.5rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.mb-8 { margin-bottom: 2rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.ml-3 { margin-left: 0.75rem !important; }

/* Flexbox utilities */
.flex { display: flex !important; }
.items-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.space-x-4 > * + * { margin-left: 1rem !important; }
.flex-1 { flex: 1 1 0% !important; }

/* Grid utilities */
.grid { display: grid !important; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.gap-4 { gap: 1rem !important; }

@media (min-width: 768px) {
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

/* Typography */
.text-xl { font-size: 1.25rem !important; line-height: 1.75rem !important; }
.text-2xl { font-size: 1.5rem !important; line-height: 2rem !important; }
.text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
.text-xs { font-size: 0.75rem !important; line-height: 1rem !important; }
.font-bold { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }
.font-medium { font-weight: 500 !important; }
.text-center { text-align: center !important; }

/* Border utilities */
.border { border-width: 1px !important; border-color: #d1d5db !important; }
.border-b { border-bottom-width: 1px !important; border-color: #e5e7eb !important; }
.border-gray-300 { border-color: #d1d5db !important; }
.border-dashed { border-style: dashed !important; }
.border-2 { border-width: 2px !important; }
.rounded { border-radius: 0.25rem !important; }
.rounded-lg { border-radius: 0.5rem !important; }
.rounded-full { border-radius: 9999px !important; }

/* Shadow utilities */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important; }

/* Form elements */
input, select, button {
    font-family: inherit;
    font-size: inherit;
}

input[type="text"], input[type="file"], select {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

button {
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, transform 0.1s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Button variants */
.btn-blue {
    background-color: #2563eb;
    color: white;
}

.btn-blue:hover:not(:disabled) {
    background-color: #1d4ed8;
}

.btn-green {
    background-color: #059669;
    color: white;
}

.btn-green:hover:not(:disabled) {
    background-color: #047857;
}

/* Utility classes */
.hidden { display: none !important; }
.block { display: block !important; }
.w-full { width: 100% !important; }
.h-3 { height: 0.75rem !important; }
.cursor-pointer { cursor: pointer !important; }
.transition-colors { transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out !important; }
.transition-all { transition: all 0.15s ease-in-out !important; }

/* Progress bar */
.progress-container {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 9999px;
    height: 0.75rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #2563eb;
    transition: width 0.5s ease-in-out;
    border-radius: 9999px;
}

/* Cards and containers */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
}

/* Header styles */
header {
    background-color: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e5e7eb;
}

/* Override Tailwind if it loads but ensure consistency */
.bg-gray-50, body { background-color: #f9fafb; }
.bg-white { background-color: #ffffff; }
.text-gray-900 { color: #111827; }

/* Progress bar enhancements */
.progress-bar-animated {
    background: linear-gradient(45deg, #3b82f6, #1d4ed8, #3b82f6);
    background-size: 200% 200%;
    animation: gradient-shift 2s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* File drop zone styles */
.drag-over {
    border-color: #3b82f6 !important;
    background-color: #eff6ff !important;
}

.drag-over .text-gray-400 {
    color: #3b82f6 !important;
}

/* Performance indicator styles */
.performance-high {
    background-color: #10b981;
    color: white;
}

.performance-medium {
    background-color: #f59e0b;
    color: white;
}

.performance-low {
    background-color: #ef4444;
    color: white;
}

/* Variable mapping styles */
.variable-mapping-item {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.variable-mapping-item:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.variable-tag {
    display: inline-block;
    background-color: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.125rem;
}

/* Error message styles */
.error-message {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.success-message {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* Worker status indicators */
.worker-active {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    background-color: #10b981;
    border-radius: 50%;
    margin-right: 0.25rem;
    animation: pulse 1s infinite;
}

.worker-idle {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    background-color: #6b7280;
    border-radius: 50%;
    margin-right: 0.25rem;
}

/* Memory usage indicator */
.memory-bar {
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
}

.memory-usage {
    height: 100%;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

.memory-warning {
    background-color: #f59e0b !important;
}

.memory-critical {
    background-color: #ef4444 !important;
}

/* Processing status styles */
.status-idle {
    color: #6b7280;
}

.status-running {
    color: #3b82f6;
}

.status-complete {
    color: #10b981;
}

.status-error {
    color: #ef4444;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .grid-cols-2.md\\:grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
    
    .grid-cols-1.md\\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .px-8 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Accessibility improvements */
.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;
}

/* Focus styles for better accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: white;
    }
    
    .text-gray-600 {
        color: #000;
    }
    
    .border-gray-300 {
        border-color: #000;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    .dark-mode .bg-gray-50 {
        background-color: #1f2937;
    }
    
    .dark-mode .bg-white {
        background-color: #374151;
    }
    
    .dark-mode .text-gray-900 {
        color: #f9fafb;
    }
    
    .dark-mode .text-gray-600 {
        color: #d1d5db;
    }
}