.fm-frontend {
    font-family: Arial, sans-serif;
    max-width: 100%;
    -webkit-text-size-adjust: 100%;
    /* Safari özel düzeltmeler */
    -webkit-font-smoothing: antialiased;
}

.fm-frontend-folder {
    margin-bottom: 10px;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    /* Safari için hardware acceleration */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.fm-folder-header {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e1e1;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
    /* Safari için */
    -webkit-appearance: none;
    -webkit-touch-callout: none;
}

/* Safari için hover düzeltmesi */
.fm-folder-header:hover,
.fm-folder-header:active,
.fm-folder-header.fm-safari-hover {
    background: #e9ecef;
}

.fm-folder-header h3 {
    margin: 0;
    color: #2c3338;
    font-size: 16px;
    font-weight: 600;
    -webkit-touch-callout: none;
    /* Safari text selection düzeltmesi */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.fm-folder-toggle {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #6c757d;
    transition: transform 0.3s ease, color 0.3s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    /* Safari için */
    -webkit-appearance: none;
    border-radius: 0; /* Safari'de border-radius sıfırla */
}

.fm-folder-toggle:hover,
.fm-folder-toggle:active {
    color: #495057;
}

.fm-folder-toggle.rotated {
    transform: rotate(180deg);
    /* Safari transform düzeltmesi */
    -webkit-transform: rotate(180deg);
}

/* KLASÖR İÇERİĞİ - SAFARI İÇİN ÖZEL */
.fm-folder-content {
    display: none !important;
    padding: 0;
    /* Safari için visibility kontrolü */
    visibility: hidden;
    opacity: 0;
    /* Safari animation fix */
    -webkit-animation-duration: 0.3s;
    animation-duration: 0.3s;
}

/* Safari için özel show class'ı */
.fm-folder-content.show,
.fm-folder-content.fm-safari-show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: fm-fadeIn 0.3s ease;
    -webkit-animation: fm-fadeIn 0.3s ease;
}

@keyframes fm-fadeIn {
    from { 
        opacity: 0;
        visibility: hidden;
    }
    to { 
        opacity: 1;
        visibility: visible;
    }
}

@-webkit-keyframes fm-fadeIn {
    from { 
        opacity: 0;
        visibility: hidden;
    }
    to { 
        opacity: 1;
        visibility: visible;
    }
}

.fm-frontend-files {
    list-style: none;
    padding: 15px;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    /* Safari grid düzeltmesi */
    -webkit-align-items: stretch;
    align-items: stretch;
}

.fm-frontend-files li {
    margin: 0;
    padding: 0;
    /* Safari list item düzeltmesi */
    -webkit-align-self: stretch;
    align-self: stretch;
}

.fm-file-link {
    text-decoration: none;
    color: #2271b1;
    font-weight: 500;
    display: block;
    padding: 10px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s ease;
    line-height: 1.3;
    word-break: break-word;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
    /* Safari için */
    -webkit-appearance: none;
    -webkit-touch-callout: none;
}

.fm-file-link:hover,
.fm-file-link:active {
    color: #135e96;
    background: #f0f6fc;
    border-color: #2271b1;
    text-decoration: none;
    transform: translateY(-1px);
    -webkit-transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* SAFARI MOBİL ÖZEL DÜZELTMELER */
@media (max-width: 768px) {
    .fm-frontend-files {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 6px;
        /* Safari mobile grid fix */
        -webkit-grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .fm-file-link {
        padding: 12px 10px;
        font-size: 14px;
        /* Safari mobile font fix */
        -webkit-text-size-adjust: none;
    }
    
    .fm-folder-header {
        padding: 18px 15px;
    }
    
    .fm-folder-header h3 {
        font-size: 16px;
    }
    
    .fm-folder-toggle {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
    
    /* Safari mobile single column */
    @supports (-webkit-touch-callout: none) {
        .fm-frontend-files {
            grid-template-columns: 1fr;
            -webkit-grid-template-columns: 1fr;
        }
    }
}

/* iOS SAFARI ÖZEL DÜZELTMELER */
@supports (-webkit-touch-callout: none) {
    .fm-frontend {
        /* iOS Safari container fix */
        -webkit-overflow-scrolling: touch;
    }
    
    .fm-folder-header {
        /* iOS touch improvement */
        -webkit-user-select: none;
        user-select: none;
    }
    
    .fm-file-link {
        /* iOS link appearance */
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* iOS Safari 14+ specific fixes */
    @media not all and (min-resolution:.001dpcm) { 
        @supports (-webkit-appearance:none) {
            .fm-folder-content {
                display: none !important;
            }
            
            .fm-folder-content.fm-safari-show {
                display: block !important;
            }
        }
    }
}

/* SAFARI DESKTOP DÜZELTMELERİ */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) and (not (overflow:-webkit-marquee)) and (not (-ms-ime-align:auto)) {
        .fm-frontend {
            /* Safari desktop specific */
            -webkit-font-smoothing: subpixel-antialiased;
        }
        
        .fm-folder-header:hover {
            background: #e9ecef;
        }
    }
}

/* Yükleniyor animasyonu - Safari */
.fm-loading {
    opacity: 0.6;
    pointer-events: none;
}

.fm-loading::after {
    content: '...';
    animation: fm-dots 1.5s steps(4, end) infinite;
    -webkit-animation: fm-dots 1.5s steps(4, end) infinite;
}

@keyframes fm-dots {
    0%, 20% { color: rgba(0,0,0,0); text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    40% { color: #6c757d; text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    60% { text-shadow: .25em 0 0 #6c757d, .5em 0 0 rgba(0,0,0,0); }
    80%, 100% { text-shadow: .25em 0 0 #6c757d, .5em 0 0 #6c757d; }
}

@-webkit-keyframes fm-dots {
    0%, 20% { color: rgba(0,0,0,0); text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    40% { color: #6c757d; text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    60% { text-shadow: .25em 0 0 #6c757d, .5em 0 0 rgba(0,0,0,0); }
    80%, 100% { text-shadow: .25em 0 0 #6c757d, .5em 0 0 #6c757d; }
}