/* =========================================
   head.css — tools/head.php'den taşındı
   ========================================= */

/* --- PRELOADER --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

html.dark-mode #preloader {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.preloader-logo {
    width: 120px;
    height: auto;
    max-width: 80vw;
    margin-bottom: 2rem;
}

.preloader-logo-normal {
    display: block;
}

.preloader-logo-white {
    display: none;
}

html.dark-mode .preloader-logo-normal {
    display: none;
}

html.dark-mode .preloader-logo-white {
    display: block;
}

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--color-primary, #0ea5e9);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

html.dark-mode .preloader-spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-primary, #0ea5e9);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.preloader-text {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.05em;
}

html.dark-mode .preloader-text {
    color: #94a3b8;
}

@media (max-width: 640px) {
    .preloader-logo {
        width: 100px;
    }

    .preloader-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }

    .preloader-text {
        font-size: 0.75rem;
    }
}

/* --- DARK MODE TOAST --- */
#dark-mode-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 380px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f1f5f9;
    padding: 18px 20px;
    border-radius: var(--border-radius-base, 12px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    z-index: 99998;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

#dark-mode-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#dark-mode-toast .toast-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

#dark-mode-toast .toast-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: var(--border-radius-base, 6px);
    background: rgba(148, 163, 184, 0.08);
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
}

#dark-mode-toast .toast-close:hover {
    background: rgba(148, 163, 184, 0.15);
    color: #f1f5f9;
}

#dark-mode-toast h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #f1f5f9;
    line-height: 1.3;
}

#dark-mode-toast p {
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    color: #cbd5e1;
}

@media (max-width: 640px) {
    #dark-mode-toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
        padding: 16px 18px;
    }

    #dark-mode-toast .toast-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    #dark-mode-toast h4 {
        font-size: 14px;
    }

    #dark-mode-toast p {
        font-size: 12px;
    }
}

/* --- MOBİL OPTİMİZASYON --- */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


@viewport {
    width: device-width;
    zoom: 1.0;
}

img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* --- İÇERİK KARTLARI (component_helpers.php'den taşındı) --- */
.card-horizontal {
    flex-direction: row !important;
}

.card-horizontal .aspect-video {
    width: 40% !important;
    flex-shrink: 0;
}

.card-horizontal a {
    flex-direction: row !important;
}

.card-minimal {
    border: 2px solid #e5e7eb !important;
    box-shadow: none !important;
}

.card-minimal:hover {
    border-color: var(--color-primary) !important;
    box-shadow: none !important;
}

@media (max-width: 768px) {
    .card-horizontal {
        flex-direction: column !important;
    }

    .card-horizontal .aspect-video {
        width: 100% !important;
    }

    .card-horizontal a {
        flex-direction: column !important;
    }
}