/**
 * Main Stylesheet for Diverse Patterns Theme
 * Contains base styles, scrollbar, and common utilities
 */

:root {
    --color-primary: #B43DA5;
    --color-primary-dark: #902d82;
    --color-secondary: #0397DA;
    --color-secondary-dark: #026aa2;
    --font-family: 'Inter', sans-serif;
}

body {
    font-family: var(--font-family);
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-dark);
}

/* Selection Styles */
::selection {
    background: var(--color-primary);
    color: white;
}

/* Form Focus Animation */
.input-group:focus-within label {
    color: var(--color-primary);
}

.input-group:focus-within i {
    color: var(--color-primary);
}

/* Filter Button Active State */
.filter-btn.active {
    background-color: var(--color-secondary);
    color: white;
    border-color: var(--color-secondary);
}

/* Project Content Styles */
.prose-content {
    font-size: 1.125rem;
    line-height: 1.75;
    color: #4b5563;
}

.prose-content h1,
.prose-content h2,
.prose-content h3,
.prose-content h4,
.prose-content h5,
.prose-content h6 {
    font-weight: 700;
    color: #111827;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose-content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-top: 2rem;
}

.prose-content h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 2rem;
}

.prose-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 1.5rem;
}

.prose-content h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1rem;
}

.prose-content p {
    margin-bottom: 1rem;
    line-height: 1.75;
    color: #4b5563;
}

.prose-content a {
    color: var(--color-secondary);
    font-weight: 600;
    text-decoration: none;
}

.prose-content a:hover {
    text-decoration: underline;
}

.prose-content strong {
    font-weight: 700;
    color: #111827;
}

.prose-content em {
    font-style: italic;
}

.prose-content ul,
.prose-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: #4b5563;
}

.prose-content ul {
    list-style-type: disc;
}

.prose-content ol {
    list-style-type: decimal;
}

.prose-content li {
    margin-bottom: 0.5rem;
    line-height: 1.75;
}

.prose-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 1rem;
    font-style: italic;
    color: #374151;
    margin: 1rem 0;
}

.prose-content code {
    background-color: #f3f4f6;
    color: var(--color-primary);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
}

.prose-content pre {
    background-color: #111827;
    color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.prose-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

.prose-content img {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
    max-width: 100%;
    height: auto;
}

.prose-content hr {
    border: none;
    border-top: 1px solid #d1d5db;
    margin: 2rem 0;
}

.prose-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.prose-content th,
.prose-content td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
    text-align: left;
}

.prose-content th {
    background-color: #f9fafb;
    font-weight: 700;
    color: #111827;
}

/* Mobile Menu Modal Styles */
.mobile-menu-modal {
    z-index: 9999;
}

.mobile-menu-modal .mobile-link {
    text-align: center;
}

.mobile-menu-modal .mobile-link:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

#mobile-menu-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Hero Section Mobile & Tablet Contrast Improvements */
@media (max-width: 1024px) {
    /* Ensure text has sufficient contrast on mobile and tablet */
    section#home h1.text-gray-800,
    section#hero-section h1.text-gray-800,
    section#about-hero h1.text-gray-800 {
        color: #1f2937; /* gray-800 for better contrast */
    }
    
    section#home p.text-gray-700,
    section#hero-section p.text-gray-700,
    section#about-hero p.text-gray-700 {
        color: #374151; /* gray-700 for better contrast */
    }
    
    /* Reduce gradient opacity on mobile/tablet for all hero sections */
    section .absolute.inset-0.z-0 > div.animate-float-blob,
    section .absolute.inset-0.z-0 > div.animate-float-blob-delayed,
    section .absolute.inset-0 > div.animate-float-blob,
    section .absolute.inset-0 > div.animate-float-blob-delayed {
        opacity: 0.08 !important;
    }
    
    /* Increase white overlay on mobile/tablet for all hero sections */
    section .absolute.inset-0.z-0 > div:last-child[class*="bg-white"],
    section .absolute.inset-0 > div:last-child[class*="bg-white"] {
        background-color: rgba(255, 255, 255, 0.3) !important;
    }
}

/* Search Modal Styles */
#search-modal {
    z-index: 9999;
}

#search-modal:not(.hidden) {
    opacity: 1;
}

#search-modal .bg-white {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#search-results {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) #f1f1f1;
}

#search-results::-webkit-scrollbar {
    width: 6px;
}

#search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#search-results::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 3px;
}

#search-results::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-dark);
}

/* Search Input Focus Styles */
#search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(180, 61, 165, 0.1);
}

/* Search Results Link Styles */
#search-results a {
    text-decoration: none;
}

#search-results a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Search Button Focus Styles */
#search-toggle-btn:focus,
#search-toggle-btn-mobile:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Search Close Button Focus Styles */
#search-close-btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Search Modal Animation */
@keyframes searchModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes searchModalScaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#search-modal:not(.hidden) .bg-white {
    animation: searchModalScaleIn 0.3s ease-out;
}

/* Mobile Search Modal Adjustments */
@media (max-width: 768px) {
    #search-modal .bg-white {
        max-height: 85vh;
        margin: 1rem;
    }
    
    #search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Screen Reader Only - 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-width: 0;
}
