/* Custom styles */
textarea {
    resize: vertical;
    min-height: 150px;
    transition: border-color 0.3s ease;
    font-size: 16px; /* Improved readability */
    line-height: 1.5; /* Better line spacing */
}

textarea:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2); /* Focus indicator */
}

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

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

/* Button hover effects */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:not(:disabled):hover {
    transform: translateY(-1px); /* Subtle lift effect */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Shadow on hover */
}

button:not(:disabled):active {
    transform: translateY(0); /* Press effect */
}

/* Success animation */
.success-animation {
    animation: success-pulse 0.5s ease-in-out;
}

@keyframes success-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* SEO and UX improvements */
h1, h2, h3 {
    color: #2d3748;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 2.25rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.75rem;
    line-height: 1.3;
}

h3 {
    font-size: 1.25rem;
    line-height: 1.4;
}

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Responsive improvements */
@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Accessibility improvements */
:focus {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

/* Feature highlight boxes */
.feature-box {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Navbar styles */
.navbar-active {
    @apply border-b-2 border-blue-500 text-blue-600;
}

/* Mobile menu animations */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

/* Blog specific styles */
.prose {
    max-width: none;
}

.prose h2 {
    @apply text-2xl font-semibold text-gray-800 mt-8 mb-4;
    scroll-margin-top: 100px; /* Account for sticky navbar */
}

.prose h3 {
    @apply text-xl font-semibold text-gray-700 mt-6 mb-3;
}

.prose p {
    @apply mb-4 leading-relaxed;
}

.prose ul {
    @apply list-disc pl-6 space-y-2 mb-4;
}

.prose ol {
    @apply list-decimal pl-6 space-y-2 mb-4;
}

.prose blockquote {
    @apply border-l-4 border-blue-500 pl-4 italic text-gray-700 my-4;
}

.prose code {
    @apply bg-gray-100 px-2 py-1 rounded text-sm font-mono;
}

.prose pre {
    @apply bg-gray-900 text-white p-4 rounded-lg overflow-x-auto my-4;
}

.prose pre code {
    @apply bg-transparent px-0 py-0;
}

/* Skip link accessibility */
.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\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Table of contents styling */
nav ul li a {
    @apply text-blue-600 hover:text-blue-800 hover:underline transition-colors;
}

/* Article navigation */
nav[aria-label="Post navigation"] a {
    @apply max-w-xs truncate;
}

/* Focus states for better accessibility */
a:focus,
button:focus {
    @apply outline-2 outline-blue-500 outline-offset-2;
}

/* Responsive improvements */
@media (max-width: 640px) {
    .prose h1 {
        @apply text-2xl;
    }
    
    .prose h2 {
        @apply text-xl;
    }
    
    nav[aria-label="Post navigation"] {
        @apply flex-col space-y-4;
    }
}
