/**
 * Frontend Styles - WooCommerce Sipariş Dosyaları
 * Temadan bağımsız, evrensel tasarım
 * Version: 1.0.2
 */

/* =====================================
   GENEL SIFIRLAMA & YAPILANDIRMA
===================================== */

.wcof-customer-files * {
    box-sizing: border-box;
}

/* =====================================
   ANA CONTAINER
===================================== */

.wcof-customer-files {
    margin: 2.5rem 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

/* Başlık */
.wcof-customer-files-title {
    margin: 0 0 1.5rem 0;
    padding: 0 0 1rem 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    border-bottom: 3px solid #0073aa;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    line-height: 1.3;
}

.wcof-customer-files-title::before {
    content: "📁";
    font-size: 2rem;
    line-height: 1;
}

/* İçerik Wrapper */
.wcof-customer-files-wrapper {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Açıklama Metni */
.wcof-intro-text {
    margin: 0 0 1.5rem 0;
    padding: 1rem;
    background: #f7f9fc;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
    color: #4a5568;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* =====================================
   DOSYA LİSTESİ
===================================== */

.wcof-customer-files-list {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* =====================================
   DOSYA KARTI
===================================== */

.wcof-file-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    background: #fafafa;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.wcof-file-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #0073aa, #005a87);
    transform: scaleY(0);
    transition: transform 0.25s ease;
}

.wcof-file-item:hover {
    background: #ffffff;
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
    transform: translateY(-2px);
}

.wcof-file-item:hover::before {
    transform: scaleY(1);
}

/* =====================================
   DOSYA İKONU
===================================== */

.wcof-file-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 2rem;
    transition: all 0.25s ease;
}

.wcof-file-item:hover .wcof-file-icon {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: scale(1.05);
}

.wcof-file-icon .dashicons,
.wcof-file-icon span {
    font-size: 2rem !important;
    width: 2rem !important;
    height: 2rem !important;
    line-height: 1 !important;
}

/* =====================================
   DOSYA BİLGİLERİ
===================================== */

.wcof-file-info {
    flex: 1;
    min-width: 0;
}

.wcof-file-title {
    margin: 0 0 0.5rem 0;
    padding: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.wcof-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.wcof-file-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.wcof-file-meta .dashicons {
    font-size: 1rem !important;
    width: 1rem !important;
    height: 1rem !important;
    color: #0073aa;
    opacity: 0.8;
}

/* Dosya Boyutu Badge */
.wcof-file-size {
    padding: 0.25rem 0.625rem;
    background: #e8f4f8;
    border-radius: 4px;
    font-weight: 500;
    color: #0073aa;
}

/* İndirme Sayısı */
.wcof-file-downloads {
    color: #059669;
    font-weight: 500;
}

/* Süre Dolmuş Badge */
.wcof-file-expired {
    padding: 0.25rem 0.625rem;
    background: #fef2f2;
    border-radius: 4px;
    font-weight: 500;
    color: #dc2626;
}

/* Süre Dolmuş Dosya */
.wcof-file-item.wcof-expired {
    opacity: 0.7;
    background: #fafafa;
}

.wcof-file-item.wcof-expired:hover {
    transform: none;
    box-shadow: none;
}

.wcof-file-item.wcof-expired .wcof-file-icon {
    opacity: 0.5;
}

/* Disabled Buton */
.wcof-btn-disabled {
    background: #d1d5db !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.wcof-btn-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* =====================================
   İNDİRME BUTONU
===================================== */

.wcof-file-download {
    flex-shrink: 0;
}

.wcof-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
    white-space: nowrap;
}

.wcof-download-btn:hover,
.wcof-download-btn:focus {
    background: linear-gradient(135deg, #005a87 0%, #004666 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
    text-decoration: none;
}

.wcof-download-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 115, 170, 0.2);
}

.wcof-download-btn .dashicons {
    font-size: 1.125rem !important;
    width: 1.125rem !important;
    height: 1.125rem !important;
    margin: 0 !important;
}

/* =====================================
   BOŞ DURUM
===================================== */

.wcof-no-files {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    color: #6b7280;
}

.wcof-no-files-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.wcof-no-files p {
    margin: 0;
    font-size: 1rem;
}

/* =====================================
   LOADING STATE
===================================== */

.wcof-loading {
    position: relative;
    pointer-events: none;
}

.wcof-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    z-index: 10;
}

/* =====================================
   ANIMASYONLAR
===================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wcof-file-item {
    animation: fadeInUp 0.4s ease-out backwards;
}

.wcof-file-item:nth-child(1) { animation-delay: 0.05s; }
.wcof-file-item:nth-child(2) { animation-delay: 0.1s; }
.wcof-file-item:nth-child(3) { animation-delay: 0.15s; }
.wcof-file-item:nth-child(4) { animation-delay: 0.2s; }
.wcof-file-item:nth-child(5) { animation-delay: 0.25s; }
.wcof-file-item:nth-child(n+6) { animation-delay: 0.3s; }

/* =====================================
   RESPONSIVE TASARIM
===================================== */

/* Tablet (768px ve altı) */
@media screen and (max-width: 768px) {
    .wcof-customer-files {
        margin: 1.5rem 0;
    }
    
    .wcof-customer-files-title {
        font-size: 1.5rem;
    }
    
    .wcof-customer-files-wrapper {
        padding: 1.25rem;
        border-radius: 6px;
    }
    
    .wcof-file-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .wcof-file-icon {
        width: 56px;
        height: 56px;
    }
    
    .wcof-file-info {
        text-align: center;
    }
    
    .wcof-file-meta {
        justify-content: center;
        font-size: 0.8125rem;
    }
    
    .wcof-download-btn {
        width: 100%;
        padding: 0.875rem 1.25rem;
    }
}

/* Mobil (480px ve altı) */
@media screen and (max-width: 480px) {
    .wcof-customer-files {
        margin: 1rem 0;
    }
    
    .wcof-customer-files-title {
        font-size: 1.25rem;
        gap: 0.5rem;
    }
    
    .wcof-customer-files-title::before {
        font-size: 1.5rem;
    }
    
    .wcof-customer-files-wrapper {
        padding: 1rem;
        border-radius: 4px;
    }
    
    .wcof-intro-text {
        font-size: 0.875rem;
        padding: 0.75rem;
    }
    
    .wcof-file-item {
        padding: 1rem;
        gap: 0.875rem;
    }
    
    .wcof-file-icon {
        width: 48px;
        height: 48px;
        border-radius: 8px;
    }
    
    .wcof-file-icon .dashicons,
    .wcof-file-icon span {
        font-size: 1.5rem !important;
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    .wcof-file-title {
        font-size: 1rem;
    }
    
    .wcof-file-meta {
        font-size: 0.75rem;
        gap: 0.5rem 1rem;
    }
    
    .wcof-download-btn {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }
}

/* =====================================
   PRINT STYLES
===================================== */

@media print {
    .wcof-customer-files-wrapper {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .wcof-file-item {
        page-break-inside: avoid;
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .wcof-download-btn,
    .wcof-file-item::before {
        display: none !important;
    }
}

/* =====================================
   ACCESSIBILITY
===================================== */

.wcof-download-btn:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

.wcof-file-item:focus-within {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .wcof-file-item,
    .wcof-download-btn,
    .wcof-file-icon,
    .wcof-file-item::before {
        animation: none;
        transition: none;
    }
    
    .wcof-file-item:hover,
    .wcof-download-btn:hover {
        transform: none;
    }
}

/* =====================================
   DARK MODE SUPPORT (Otomatik)
===================================== */

@media (prefers-color-scheme: dark) {
    .wcof-customer-files-title {
        color: #f0f0f0;
        border-bottom-color: #3b9dd6;
    }
    
    .wcof-customer-files-wrapper {
        background: #1e1e1e;
        border-color: #3a3a3a;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .wcof-intro-text {
        background: #2a2a2a;
        border-left-color: #3b9dd6;
        color: #b0b0b0;
    }
    
    .wcof-file-item {
        background: #2a2a2a;
        border-color: #3a3a3a;
    }
    
    .wcof-file-item::before {
        background: linear-gradient(to bottom, #3b9dd6, #2980b9);
    }
    
    .wcof-file-item:hover {
        background: #333333;
        border-color: #3b9dd6;
        box-shadow: 0 4px 12px rgba(59, 157, 214, 0.2);
    }
    
    .wcof-file-icon {
        background: #1e1e1e;
        border-color: #3a3a3a;
    }
    
    .wcof-file-item:hover .wcof-file-icon {
        background: #2a3d4d;
        border-color: #3b9dd6;
    }
    
    .wcof-file-title {
        color: #f0f0f0;
    }
    
    .wcof-file-meta {
        color: #b0b0b0;
    }
    
    .wcof-file-meta .dashicons {
        color: #3b9dd6;
    }
    
    .wcof-file-size {
        background: #2a3d4d;
        color: #3b9dd6;
    }
    
    .wcof-download-btn {
        background: linear-gradient(135deg, #3b9dd6 0%, #2980b9 100%);
    }
    
    .wcof-download-btn:hover {
        background: linear-gradient(135deg, #2980b9 0%, #1f5f8f 100%);
    }
    
    .wcof-no-files {
        background: #2a2a2a;
        border-color: #3a3a3a;
        color: #b0b0b0;
    }
}

/* =====================================
   RTL SUPPORT (Sağdan Sola Diller)
===================================== */

[dir="rtl"] .wcof-customer-files-title {
    flex-direction: row-reverse;
}

[dir="rtl"] .wcof-intro-text {
    border-left: none;
    border-right: 4px solid #0073aa;
}

[dir="rtl"] .wcof-file-item::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .wcof-file-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .wcof-file-meta {
    flex-direction: row-reverse;
}
