/**
 * Services eklentisi için minimal CSS stilleri
 * Tailwind CSS kullanıldığı için sadece gerekli özel stiller
 */

/* Service grid - Global sidebar durumuna göre responsive grid */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    transition: grid-template-columns 0.3s ease;
    align-items: start; /* Ensure cards align at the top */
}

/* Ensure all cards in the grid have equal height */
.service-grid .service-card {
    height: 100%; /* Make all cards the same height */
    display: flex !important;
    flex-direction: column;
}

/* Global sidebar kapalı durumunda - maksimum 5 kart */
body:not(.sidebar-expanded) .service-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Global sidebar açık durumunda - maksimum 4 kart */
body.sidebar-expanded .service-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Ekran boyutlarına göre responsive ayarlar - Global sidebar kapalı */
@media (min-width: 640px) and (max-width: 1023px) {
    body:not(.sidebar-expanded) .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    body:not(.sidebar-expanded) .service-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) and (max-width: 1535px) {
    body:not(.sidebar-expanded) .service-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1536px) {
    body:not(.sidebar-expanded) .service-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Ekran boyutlarına göre responsive ayarlar - Global sidebar açık */
@media (min-width: 640px) and (max-width: 1023px) {
    body.sidebar-expanded .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    body.sidebar-expanded .service-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) and (max-width: 1535px) {
    body.sidebar-expanded .service-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1536px) {
    body.sidebar-expanded .service-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Çok küçük ekranlarda tek sütun */
@media (max-width: 639px) {
    .service-grid {
        grid-template-columns: 1fr;
    }
    
    /* Ensure cards maintain consistent height on mobile */
    .service-grid .service-card {
        min-height: 280px; /* Smaller on mobile */
    }
    
    /* Adjust title height for mobile */
    .service-card h2 {
        min-height: 2.2em; /* Smaller on mobile */
        max-height: 2.2em;
    }
}

/* Kart boyutları değişmeden ekrana sığmıyorsa otomatik azaltma */
@media (max-width: 1200px) {
    body.sidebar-expanded .service-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 1000px) {
    body:not(.sidebar-expanded) .service-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* JavaScript ile eklenen class'lar için ek stiller */
.service-grid.sidebar-expanded-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.service-grid.sidebar-collapsed-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* JavaScript class'ları ile responsive ayarlar */
@media (min-width: 640px) and (max-width: 1023px) {
    .service-grid.sidebar-expanded-grid,
    .service-grid.sidebar-collapsed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .service-grid.sidebar-collapsed-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .service-grid.sidebar-expanded-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) and (max-width: 1535px) {
    .service-grid.sidebar-collapsed-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .service-grid.sidebar-expanded-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1536px) {
    .service-grid.sidebar-collapsed-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .service-grid.sidebar-expanded-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Service card styling - Using Tailwind classes in templates */
.service-card {
    @apply flex flex-col h-full;
    border: none !important;
    background-color: transparent !important;
    min-height: 320px; /* Reduced card height */
    display: flex !important; /* Force flex display */
    transition: transform 0.2s, box-shadow 0.2s;
}

.service-card .p-4 {
    @apply flex flex-col flex-grow;
    height: 100%; /* Ensure full height usage */
    display: flex !important; /* Force flex display */
    justify-content: flex-start; /* Align content to top */
    padding: 1rem; /* Reduced padding */
}

.service-card h2 {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    min-height: 2.6em; /* Reduced height for 2 lines */
    max-height: 2.6em; /* Prevent overflow */
    margin-bottom: 0.5rem; /* Reduced spacing */
    word-wrap: break-word; /* Handle long words */
    hyphens: auto; /* Add hyphenation for better text flow */
    flex-grow: 0; /* Don't expand title area */
}

/* Fallback for browsers that don't support -webkit-line-clamp */
@supports not (-webkit-line-clamp: 2) {
    .service-card h2 {
        display: block;
        height: 2.8em; /* Fixed height for 2 lines */
        overflow: hidden;
        position: relative;
    }
    
    .service-card h2::after {
        content: '...';
        position: absolute;
        bottom: 0;
        right: 0;
        background: linear-gradient(to right, transparent, var(--color-background) 50%);
        padding-left: 1rem;
    }
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
}

/* Gallery thumbnail active state */
.thumbnail-item.active {
    border: 2px solid #3b82f6; /* blue-500 */
    transform: scale(1.03);
}

/* Service Gallery Layout */
.service-gallery {
    background-color: var(--color-card, #0f0f0f);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Desktop gallery layout - thumbnails on the right */
@media (min-width: 1024px) {
    .gallery-container {
        flex-direction: row;
        align-items: flex-start;
    }
}

.gallery-main {
    flex-grow: 1;
}

.main-image-container {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    width: 100%;
    max-width: 1056px;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Mobile 16:9 aspect ratio */
@media (max-width: 1200px) {
    .main-image-container {
        aspect-ratio: 16/9;
        max-height: 594px;
    }
    
    .main-image-container img {
        height: 100%;
        object-fit: cover;
    }
}

/* Tablet 16:9 aspect ratio */
@media (max-width: 768px) {
    .main-image-container {
        aspect-ratio: 16/9;
        max-height: 400px;
    }
}

/* Mobile 16:9 aspect ratio */
@media (max-width: 480px) {
    .main-image-container {
        aspect-ratio: 16/9;
        max-height: 300px;
    }
}

.gallery-thumbnails {
    width: 100%;
}

/* Desktop gallery thumbnails */
@media (min-width: 1024px) {
    .gallery-thumbnails {
        width: 7rem; /* Increased width for better visibility */
        flex-shrink: 0;
    }
}

.thumbnails-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Desktop thumbnail layout */
@media (min-width: 1024px) {
    .thumbnails-scroll {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        height: 100%; /* Match the height of main image container */
        padding-right: 4px; /* Add space for scrollbar */
        gap: 0.25rem; /* Gap between thumbnails */
    }
    
    /* Calculate thumbnail height for 5 images - Square thumbnails */
    .thumbnail-item {
        height: 80px; /* Smaller height to fit within main image */
        width: 80px; /* Square thumbnails */
        aspect-ratio: 1/1; /* Force square aspect ratio */
        flex-shrink: 0;
    }
}

.thumbnails-scroll::-webkit-scrollbar {
    display: none;
}

.thumbnail-item {
    cursor: pointer;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    flex-shrink: 0;
}

.thumbnail-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-item:hover {
    opacity: 0.9;
}

/* Hide scrollbar for thumbnails */
.thumbnails-scroll { 
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}

.thumbnails-scroll::-webkit-scrollbar { 
    display: none; 
}

/* Thumbnails baseline and active styles */
.thumbnail-item { 
    border-width: 1px; 
    border-color: transparent; 
    border-radius: 0.5rem; 
}

.thumbnail-item img { 
    display: block; 
}

.thumbnail-item.active { 
    border-color: #3b82f6; 
    transform: scale(1.05); 
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2); 
}

/* CSS Custom Properties for Related Services */
:root {
    --color-background: #000000;
    --color-surface: #0f0f0f;
}

/* Related Services - Match main service card design */
.related-service-card {
    background-color: #000000 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform: translateY(0);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.related-service-card:hover {
    background-color: #0f0f0f !important;
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.5) !important;
}

/* Related service image hover effect - match main cards */
.related-service-card:hover .related-service-image {
    transform: scale(1.02) !important;
}

.related-service-image {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Related service title hover effect */
.related-service-card:hover .related-service-title a {
    color: #60a5fa !important; /* blue-400 */
}

.related-service-title a {
    transition: color 0.3s ease !important;
}

/* Related service username hover effect */
.related-service-card:hover .related-service-username {
    color: #93c5fd !important; /* blue-300 */
}

.related-service-username {
    transition: color 0.3s ease !important;
    text-decoration: none;
}

.related-service-username:hover {
    color: #60a5fa !important; /* blue-400 */
}

/* Avatar styling for related services */
.related-service-avatar {
    transition: all 0.3s ease !important;
}

.related-service-card:hover .related-service-avatar {
    transform: scale(1.05) !important;
}

/* Author Bio - Force remove ellipsis */
.author-bio-short {
    text-overflow: clip !important;
    -webkit-text-overflow: clip !important;
    -moz-text-overflow: clip !important;
    -ms-text-overflow: clip !important;
    -o-text-overflow: clip !important;
}

.author-bio-short::after {
    content: none !important;
}

/* RTL desteği */
.rtl .service-meta-item .meta-icon {
    margin-right: 0;
    margin-left: 0.5rem;
}

.rtl .service-features-list .feature-icon {
    margin-right: 0;
    margin-left: 0.5rem;
}

.rtl .service-sidebar {
    padding-left: 0;
    padding-right: 1rem;
}