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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #374151;
    background-color: #f9fafb;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        color: #e5e7eb;
        background-color: #111827;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

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

.bg-gradient-to-br {
    background: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.from-blue-50 {
    --tw-gradient-from: #eff6ff;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(239, 246, 255, 0));
}

.to-indigo-100 {
    --tw-gradient-to: #e0e7ff;
}

@media (prefers-color-scheme: dark) {
    .dark\:from-gray-900 {
        --tw-gradient-from: #111827;
        --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(17, 24, 39, 0));
    }
    
    .dark\:to-gray-800 {
        --tw-gradient-to: #1f2937;
    }
}

.p-4 {
    padding: 1rem;
}

.p-8 {
    padding: 2rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.flex {
    display: flex;
}

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

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

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

.max-w-md {
    max-width: 28rem;
}

.max-w-2xl {
    max-width: 42rem;
}

.w-full {
    width: 100%;
}

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

.bg-white {
    background-color: #ffffff;
}

@media (prefers-color-scheme: dark) {
    .dark\:bg-gray-800 {
        background-color: #1f2937;
    }
    
    .dark\:bg-gray-700 {
        background-color: #374151;
    }
}

.rounded-2xl {
    border-radius: 1rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

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

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

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

.font-mono {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
}

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

.text-gray-800 {
    color: #1f2937;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-500 {
    color: #6b7280;
}

@media (prefers-color-scheme: dark) {
    .dark\:text-white {
        color: #ffffff;
    }
    
    .dark\:text-gray-400 {
        color: #9ca3af;
    }
    
    .dark\:text-gray-300 {
        color: #d1d5db;
    }
    
    .dark\:text-gray-200 {
        color: #e5e7eb;
    }
}

.mb-8 {
    margin-bottom: 2rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.space-y-3 > * + * {
    margin-top: 0.75rem;
}

.block {
    display: block;
}

/* Form styles */
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

input[type="password"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px #3b82f6;
}

@media (prefers-color-scheme: dark) {
    input[type="password"],
    input[type="number"] {
        background-color: #374151;
        border-color: #4b5563;
        color: #ffffff;
    }
}

/* Button styles */
button {
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.bg-blue-600 {
    background-color: #2563eb;
    color: #ffffff;
}

.bg-blue-600:hover {
    background-color: #1d4ed8;
}

.bg-gray-500 {
    background-color: #6b7280;
    color: #ffffff;
}

.bg-gray-500:hover {
    background-color: #4b5563;
}

/* Grid styles */
.grid {
    display: grid;
}

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

.gap-4 {
    gap: 1rem;
}

.flex-1 {
    flex: 1 1 0%;
}

/* Mode button styles */
.mode-btn {
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px solid;
    transition: all 0.2s;
    cursor: pointer;
    background: transparent;
    font-weight: normal;
    color: inherit;
}

.mode-btn.active {
    border-color: #3b82f6 !important;
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
}

.mode-btn:not(.active) {
    border-color: #d1d5db;
    color: #374151;
}

.mode-btn:not(.active):hover {
    border-color: #9ca3af;
}

@media (prefers-color-scheme: dark) {
    .mode-btn.active {
        background-color: rgba(59, 130, 246, 0.2) !important;
        color: #93c5fd !important;
    }

    .mode-btn:not(.active) {
        border-color: #4b5563;
        color: #e5e7eb;
    }

    .mode-btn:not(.active):hover {
        border-color: #6b7280;
    }
}

/* Result styles */
.bg-green-50 {
    background-color: #f0fdf4;
}

.bg-blue-50 {
    background-color: #eff6ff;
}

.border-green-200 {
    border-color: #bbf7d0;
}

.border-blue-200 {
    border-color: #bfdbfe;
}

.text-green-800 {
    color: #166534;
}

.text-blue-800 {
    color: #1e40af;
}

.text-green-700 {
    color: #15803d;
}

.text-blue-700 {
    color: #1d4ed8;
}

@media (prefers-color-scheme: dark) {
    .dark\:bg-green-900\/20 {
        background-color: rgba(20, 83, 45, 0.2);
    }
    
    .dark\:bg-blue-900\/20 {
        background-color: rgba(30, 58, 138, 0.2);
    }
    
    .dark\:border-green-800 {
        border-color: #166534;
    }
    
    .dark\:border-blue-800 {
        border-color: #1e40af;
    }
    
    .dark\:text-green-300 {
        color: #86efac;
    }
    
    .dark\:text-blue-300 {
        color: #93c5fd;
    }
    
    .dark\:text-green-400 {
        color: #4ade80;
    }
    
    .dark\:text-blue-400 {
        color: #60a5fa;
    }
}

.text-red-600 {
    color: #dc2626;
}

@media (prefers-color-scheme: dark) {
    .dark\:text-red-400 {
        color: #f87171;
    }
}

.border {
    border-width: 1px;
}

.border-2 {
    border-width: 2px;
}

.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Responsive design */
@media (max-width: 768px) {
    .p-4 {
        padding: 0.5rem;
    }
    
    .p-8 {
        padding: 1rem;
    }
    
    .text-3xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .gap-4 {
        gap: 0.5rem;
    }
}
