/* Öneri 3.B: Tüm bu özel CSS kurallarını daha iyi bakım için harici bir style.css dosyasına taşımanız tavsiye edilir. */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f7f9fc;
    color: #333;
    line-height: 1.6;
    min-height: 10vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 0; 
}

main {
    flex-grow: 1; 
}

/* AI-CARD STYLES - Hata düzeltildi ve iyileştirildi */
.ai-card {
    transition: transform 0.25s ease-out, box-shadow 0.25s ease-out, border 0.25s ease-out;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: white;
    min-height: 250px;
    position: relative;
}

/* Butonların kartın içinde görünmesi için */
.ai-card > * {
    position: relative;
    z-index: 1;
}

.ai-card .favorite-btn,
.ai-card .share-btn {
    z-index: 10;
    position: absolute;
}

.ai-card:hover {
    transform: translateY(-4px); /* Kartı hafifçe yukarı kaldır */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); /* Daha belirgin gölge */
    border: 1px solid #cbd5e1; /* Hover'da daha yumuşak çerçeve */
}

.ai-card:hover .favorite-btn,
.ai-card:hover .share-btn {
    opacity: 1 !important;
    visibility: visible !important;
}

.ai-card-content-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    min-height: 60px;
    padding-top: 8px;
    width: 100%;
    overflow: visible;
}

.favorite-btn, .share-btn {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 20;
    opacity: 1 !important;
    visibility: visible !important;
    cursor: pointer;
}

.dark .favorite-btn, .dark .share-btn {
    background: rgba(45, 45, 45, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    color: #6b7280;
}
.dark .favorite-btn i, .dark .share-btn i {
    color: #9ca3af;
}
.dark .share-btn:hover {
    background: #1f2937;
    border-color: #374151;
}
.dark .favorite-btn:hover {
    background: #1f2937;
    border-color: #374151;
}
.dark .share-btn:hover i {
    color: #3b82f6;
}
.dark .favorite-btn:hover i {
    color: #ef4444;
}

.favorite-btn:hover, .share-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.favorite-btn i, .share-btn i {
    font-size: 12px;
}

/* Butonların her zaman görünür olması için */
.ai-card .favorite-btn,
.ai-card .share-btn {
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
}

.ai-card:hover .favorite-btn,
.ai-card:hover .share-btn {
    opacity: 1;
}

/* Mobilde butonları daha görünür yap */
@media (max-width: 640px) {
    .favorite-btn, .share-btn {
        width: 24px !important;
        height: 24px !important;
        opacity: 1 !important;
    }
    
    .favorite-btn i, .share-btn i {
        font-size: 11px;
    }
    
    #keyboardShortcutsBtn {
        display: none !important;
    }
}

#searchBarContainer {
    flex-wrap: wrap;
    max-width: 100%;
}
#keyboardShortcutsBtn {
    flex-shrink: 0;
}
#totalModelsCount {
    margin-left: 8px;
    padding: 0;
}
.dark #totalModelsCount {}

@media (max-width: 640px) {
    #totalModelsCount {
        display: block;
        width: 90%;
        margin: 0.25rem auto 0.5rem auto;
        color: #6b7280;
        text-align: center;
        box-sizing: border-box;
        border-radius: 0;
        line-height: 1.6;
        font-size: 0.875rem;
    }
}

.dark h1 {
    color: #d1d5db;
}

#searchHistory {
    max-height: 200px;
    overflow-y: auto;
}

#favoritesToggle, #keyboardShortcutsBtn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#favoritesToggle i, #keyboardShortcutsBtn i {
    font-size: 14px;
}
.dark #favoritesToggle:hover i, .dark #keyboardShortcutsBtn:hover i,
#favoritesToggle:hover i, #keyboardShortcutsBtn:hover i {
    color: #dc2626;
}
.dark #favoritesToggle, .dark #keyboardShortcutsBtn {
    background-color: #1f2937;
    border-color: #374151;
}
.dark #favoritesToggle:hover, .dark #keyboardShortcutsBtn:hover {
    background-color: #374151;
}

.dark #searchHistory {
    background-color: #2d2d2d;
    border-color: #404040;
}

.dark #searchHistory div {
    color: #e5e5e5;
    border-color: #404040;
}

.dark #searchHistory div:hover {
    background-color: #3d3d3d;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.dark .loading-skeleton {
    background: linear-gradient(90deg, #2d2d2d 25%, #3d3d3d 50%, #2d2d2d 75%);
    background-size: 200% 100%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.card-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border-radius: 50%;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.icon-openai { background-color: #4CAF50; }
.icon-midjourney { background-color: #9C27B0; }
.icon-stable { background-color: #2196F3; }
.icon-anthropic { background-color: #FF9800; }
.icon-google { background-color: #F44336; }
.icon-meta { background-color: #03A9F4; }
.icon-hugging { background-color: #000000; }

.icon-grok { background-color: #000000; } 

.icon-github-copilot { background-color: #6e5494; }

.icon-model-x1 { background-color: #4c1d95; } 
.icon-model-y2 { background-color: #facc15; } 
.icon-model-codegen { background-color: #115e59; } 
.icon-model-omni { background-color: #84cc16; } 
.icon-model-turkce { background-color: #be185d; } 
.icon-model-editor { background-color: #6d28d9; } 
.icon-model-shell { background-color: #475569; } 
.icon-model-essay { background-color: #ca8a04; } 
.icon-model-dream { background-color: #065f46; } 
.icon-model-video { background-color: #e11d48; } 
.icon-model-finance { background-color: #374151; }
.icon-model-logo { background-color: #db2777; } 
.icon-model-sql { background-color: #0e7490; } 
.icon-model-audio { background-color: #65a30d; } 
.icon-model-translator { background-color: #7e22ce; } 
.icon-model-3d { background-color: #f97316; }
.icon-model-debugger { background-color: #dc2626; } 
.icon-model-chatbot { background-color: #2563eb; } 
.icon-model-local { background-color: #fb923c; } 
.icon-model-dataviz { background-color: #059669; }

.custom-dropdown {
    position: relative;
    display: inline-block;
    user-select: none;
}

.dropdown-button {
    color: #111827;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
    font-size: 0.875rem;
    height: auto;
}
.custom-dropdown .dropdown-button span {
    font-size: inherit;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.custom-dropdown .dropdown-button span#currentFilterText,
.custom-dropdown .dropdown-button span#currentPriceText,
.custom-dropdown .dropdown-button span#currentSortText {
    font-size: inherit !important;
    line-height: inherit;
}

.filter-btn-primary {
    background: #e5e7eb;
    color: #111827;
    border: 1px solid #d1d5db;
}
.filter-btn-primary:hover {
    background: #d1d5db;
}

.filter-btn-secondary {
    background: #e5e7eb;
    color: #111827;
    border: 1px solid #d1d5db;
}
.filter-btn-secondary:hover {
    background: #d1d5db;
}

.dark .filter-btn-primary {
    background: #374151;
    color: #e5e7eb;
    border: 1px solid #4b5563;
}
.dark .filter-btn-secondary {
    background: #374151;
    color: #e5e7eb;
    border: 1px solid #4b5563;
}

.dropdown-menu {
    position: absolute;
    top: 100%; 
    left: 0;
    z-index: 10;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
    border-radius: 8px;
    font-size: 0.875rem;
}

.dropdown-menu a:hover {
    background-color: #fee2e2;
    color: #dc2626;
    font-weight: 600;
}

.dropdown-menu a.active {
    background-color: #fee2e2; /* Red-100 */
    color: #dc2626; /* Red-600 */
    font-weight: 600;
}


#scrollUpBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #dc2626;
    color: white;
    cursor: pointer;
    width: 40px; 
    height: 40px;
    border-radius: 8px; 
    font-size: 18px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, transform 0.3s;
    display: flex; 
    align-items: center;
    justify-content: center;
}

#scrollUpBtn:hover {
    background-color: #b91c1c; 
    transform: scale(1.05);
}

@media (max-width: 640px) {
    .filter-container {
        flex-direction: column;
        align-items: center; 
        padding: 0 1rem; 
        justify-content: center;
    }
    
    .filter-group {
        flex-direction: column; 
        width: 100%;
        justify-content: center; 
        align-items: center;
    }
    
    .filter-group p {
        width: 100%;
        text-align: center;
        margin-bottom: 0.75rem; 
        order: -1; 
    }

    .custom-dropdown {
        width: 90%; 
        margin-bottom: 0.75rem; 
        display: flex;
        justify-content: center;
    }
    
    .custom-dropdown .dropdown-button {
        width: 100%;
        justify-content: center;
    }
    
    .dropdown-menu {
        width: 100%; 
        left: 50%; 
        transform: translateX(-50%) translateY(10px); 
    }
    
    .custom-dropdown.open .dropdown-menu {
        transform: translateX(-50%) translateY(0);
    }

    #searchBarContainer {
        width: 100%;
        max-width: 100%;
        flex-wrap: wrap;
        margin: 0.5rem auto;
        gap: 0.5rem;
    }
    #filterMetaBlock,
    #totalModelsCount {
        width: 100%;
        text-align: center;
        margin-left: 0;
    }
}

footer {
    margin-top: auto; 
    width: 100%;
    padding: 12px 0; 
    background-color: #1f2a38;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#searchInput {
    font-size: 0.875rem;
    padding: 10px 12px 10px 32px;
    height: auto;
}

.prompt-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.prompt-card:hover {
    background-color: #e0e7ff !important;
    transform: translateY(-2px);
}

.dark .prompt-card:hover {
    background-color: #1e293b !important;
    border-color: #475569;
}

.dark .bg-pink-100 { background-color: rgba(236, 72, 153, 0.18) !important; color: #f472b6 !important; }
.dark .bg-blue-100 { background-color: rgba(59, 130, 246, 0.18) !important; color: #93c5fd !important; }
.dark .bg-green-100 { background-color: rgba(34, 197, 94, 0.18) !important; color: #86efac !important; }
.dark .bg-red-100 { background-color: rgba(239, 68, 68, 0.18) !important; color: #fca5a5 !important; }
.dark .bg-purple-100 { background-color: rgba(168, 85, 247, 0.18) !important; color: #d8b4fe !important; }
.dark .bg-yellow-100 { background-color: rgba(234, 179, 8, 0.18) !important; color: #fde68a !important; }
.dark .bg-teal-100 { background-color: rgba(13, 148, 136, 0.18) !important; color: #99f6e4 !important; }

/* Pastel prompt button style */
.prompt-button-style {
    background: #f3f4f6;
    color: #111827;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 14px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.35s ease;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.08);
}

.prompt-button-style:hover {
    background: #e5e7eb;
    box-shadow: 0 6px 16px rgba(17, 24, 39, 0.12);
    transform: translateY(-2px);
    color: #111827;
}

.prompt-button-style:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(17, 24, 39, 0.1);
}

.dark .prompt-button-style {
    background: #374151;
    color: #e5e7eb;
    border: 1px solid #4b5563;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.dark .prompt-button-style:hover {
    background: #4b5563;
    color: #ffffff;
}

/* Prompt Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 680px;
    width: 100%;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
    padding: 1.25rem 1.5rem 1.5rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s ease;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #4f46e5;
}

.modal-body ul {
    list-style: disc;
    padding-left: 1.25rem;
    color: #374151;
}

.modal-body li + li {
    margin-top: 0.5rem;
}

/* Toast Notification */
#toast.show {
    transform: translateY(0);
    opacity: 1;
}

#toast {
    min-width: 0;
    max-width: none;
    width: max-content;
    font-size: 0.8125rem;
}

#resetFiltersBtn {
    font-size: 0.8125rem;
    flex-shrink: 0;
}

/* Masaüstünde dropdownlar için maksimum genişlikler (satır taşmasını önler) */
@media (min-width: 640px) {
    #categoryDropdown { max-width: 260px; }
    #priceDropdown { max-width: 260px; }
    #sortDropdown { max-width: 140px; }
    .custom-dropdown .dropdown-button { width: 100%; }
}

@media (max-width: 639px) {
    .custom-dropdown {
        width: 100%;
    }
    .custom-dropdown .dropdown-button {
        width: 100%;
    }
    #searchBarContainer {
        max-width: 100%;
        min-width: 0;
        width: 100%;
        gap: 0.25rem;
    }
    .filter-container {
        gap: 0.25rem;
    }
    .custom-dropdown .dropdown-button span#currentFilterText,
    .custom-dropdown .dropdown-button span#currentPriceText,
    .custom-dropdown .dropdown-button span#currentSortText {
        max-width: none !important;
    }
    #favoritesToggle,
    #keyboardShortcutsBtn {
        height: 40px;
        width: 40px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}


/* Skip Link (Accessibility) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #4f46e5;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Dark Mode Styles */
.dark {
    background-color: #222;
    color: #e5e5e5;
}

.dark .ai-card {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e5e5e5;
}

.dark .bg-white {
    background-color: #1a1a1a;
}

.dark .bg-gray-50 {
    background-color: #2d2d2d;
}

.dark .text-gray-900 {
    color: #e5e5e5;
}

.dark h1 .text-indigo-600 {
    color: #818cf8;
}

.dark .text-gray-600 {
    color: #a0a0a0;
}

.dark .text-indigo-600 {
    color: #818cf8;
}
.dark .ai-card .text-indigo-600:hover {
    color: #a5b4fc;
}

.dark .text-gray-500 {
    color: #888;
}

.dark .text-gray-700 {
    color: #c0c0c0;
}

.dark .text-gray-800 {
    color: #e5e5e5;
}

.dark .border-gray-300 {
    border-color: #404040;
}

.dark .border-gray-100 {
    border-color: #404040;
}

.dark .border-gray-200 {
    border-color: #404040;
}

.dark .bg-gray-200 {
    background-color: #374151;
}
.dark .hover\:bg-gray-300:hover {
    background-color: #4b5563;
}

.dark #mobileMenuButton:hover {
    background-color: #2d2d2d;
    color: #f87171;
}

.dark #searchInput {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e5e5e5;
}

.dark #searchInput::placeholder {
    color: #888;
}

.dark #searchInput:focus {
    background-color: #2d2d2d;
    border-color: #6366f1;
    color: #e5e5e5;
}

.dark header nav a:hover {
    color: #dc2626;
}

.dark footer nav a:hover {
    color: #dc2626;
}

.dark header {
    background-color: #0b1220 !important;
    border-bottom-color: #404040;
}

.dark #mobileMenu {
    background-color: #2d2d2d;
    border-color: #404040;
}

.dark #mobileMenu a {
    color: #e5e5e5;
    border-color: #404040;
}

.dark #mobileMenu a:hover {
    background-color: #3d3d3d;
    color: #dc2626;
}

.dark .modal-content {
    background-color: #2d2d2d;
    color: #e5e5e5;
}

.dark .modal-body li:hover {
    background-color: #3d3d3d;
}

.dark .bg-indigo-50 {
    background-color: #1e293b;
}

.dark .dropdown-menu {
    background-color: #2d2d2d;
    border-color: #404040;
}

.dark .dropdown-menu a {
    color: #e5e5e5;
}

.dark .dropdown-menu a:hover {
    background-color: #3d3d3d;
    color: #f87171;
}

.dark .dropdown-menu a.active {
    background-color: #3d3d3d;
    color: #f87171;
}

.dark footer {
    background-color: #111 !important;
}

.dark header.bg-white {
    background-color: #1a1a1a !important;
}
.dark footer.bg-gray-800 {
    background-color: #111 !important;
}

.dark .prompt-button-style {
    background: #374151;
    color: #e5e7eb;
    border-color: #4b5563;
}

.dark .prompt-button-style:hover {
    background: #4b5563;
    color: #ffffff;
}

/* Smooth Scroll */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Focus Visible Improvements */
*:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Search Results Styling */
#searchResults {
    font-size: 0.875rem;
    z-index: 10;
}

/* Screen Reader Only */
.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;
}

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}
