@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom styles for dark mode toggle */
.dark-mode-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.dark-mode-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #EF4444;
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

/* Smooth transitions for dark mode */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom scrollbar for dark mode */
.dark ::-webkit-scrollbar {
    width: 8px;
}

.dark ::-webkit-scrollbar-track {
    background: #1a202c;
}
.dark ::-webkit-scrollbar-thumb {
    background: #EF4444;
    border-radius: 4px;
}

/* Accessibility improvements for all interactive elements */
button, input, textarea, select {
    transition: all 0.2s ease;
    outline: 2px solid transparent;
}

button:focus-visible, 
input:focus-visible, 
textarea:focus-visible, 
select:focus-visible {
    outline: 2px solid #EF4444;
    outline-offset: 2px;
}
/* Responsive improvements */
@media (max-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    .col-span-2 {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    textarea {
        height: 150px;
    }
    button, .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Enhanced textarea styling */
textarea {
    transition: all 0.3s ease;
    min-height: 200px;
    resize: vertical;
}

textarea:focus {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}
/* Loading spinner animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}
