/* ============================================================
   YÜKLEME ANİMASYONLARI & İSKELET EKRAN
   ============================================================ */

/* Global Loading Overlay */
#ys-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
[data-theme="dark"] #ys-loading-overlay {
    background: rgba(18, 18, 18, 0.88);
}
#ys-loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.ys-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color, #e0e0e0);
    border-top-color: var(--primary-color, #e74c3c);
    border-radius: 50%;
    animation: ys-spin 0.75s linear infinite;
}
.ys-loading-text {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary, #636e72);
    font-weight: 500;
}

/* Inline Button Spinner */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ys-spin 0.65s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
.btn-spinner-dark {
    border-color: rgba(0,0,0,0.2);
    border-top-color: var(--primary-color, #e74c3c);
}

/* Skeleton Loader */
.ys-skeleton {
    background: linear-gradient(90deg,
        var(--skeleton-base, #e8e8e8) 25%,
        var(--skeleton-shimmer, #f5f5f5) 50%,
        var(--skeleton-base, #e8e8e8) 75%
    );
    background-size: 400% 100%;
    animation: ys-shimmer 1.4s ease infinite;
    border-radius: 6px;
}
[data-theme="dark"] .ys-skeleton {
    --skeleton-base: #2a2a2a;
    --skeleton-shimmer: #3a3a3a;
}

.ys-skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}
.ys-skeleton-text.short { width: 40%; }
.ys-skeleton-text.medium { width: 65%; }
.ys-skeleton-text.full { width: 100%; }

.ys-skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.ys-skeleton-card {
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e8e8e8);
    margin-bottom: 1rem;
}
.ys-skeleton-card .ys-skeleton-img {
    height: 140px;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

/* Page Transition */
.ys-page-fade-in {
    animation: ys-fadeIn 0.35s ease both;
}

/* Animasyonlar */
@keyframes ys-spin {
    to { transform: rotate(360deg); }
}
@keyframes ys-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
@keyframes ys-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Toast bildirimleri */
#ys-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 99998;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 360px;
    pointer-events: none;
}
.ys-toast {
    background: #2c3e50;
    color: #fff;
    padding: 0.85rem 1.2rem;
    border-radius: 10px;
    font-size: 0.875rem;
    line-height: 1.4;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    pointer-events: all;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: ys-toastIn 0.3s ease both;
    transition: opacity 0.3s, transform 0.3s;
}
.ys-toast.hiding {
    opacity: 0;
    transform: translateX(20px);
}
.ys-toast.success { background: #27ae60; }
.ys-toast.error   { background: #e74c3c; }
.ys-toast.warning { background: #f39c12; }
.ys-toast.info    { background: #2980b9; }
.ys-toast-icon { font-size: 1.1rem; flex-shrink: 0; }
@keyframes ys-toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Oturum zaman aşımı uyarısı */
#ys-session-warning {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 14px;
    padding: 2rem 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    z-index: 100000;
    text-align: center;
    width: 90%;
    max-width: 400px;
    display: none;
    animation: ys-fadeIn 0.3s ease both;
}
[data-theme="dark"] #ys-session-warning {
    background: #1e1e2e;
    color: #e0e0e0;
}
#ys-session-warning.visible { display: block; }
#ys-session-warning-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    display: none;
}
#ys-session-warning-backdrop.visible { display: block; }
.ys-session-warning-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.ys-session-warning-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; color: #e74c3c; }
.ys-session-warning-msg { font-size: 0.9rem; color: var(--text-secondary, #636e72); margin-bottom: 1.5rem; }
.ys-session-warning-countdown { font-size: 2rem; font-weight: 800; color: #e74c3c; margin-bottom: 1.25rem; }
.ys-session-warning-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.ys-session-btn {
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.2s;
}
.ys-session-btn:hover { opacity: 0.85; }
.ys-session-btn-extend { background: var(--primary-color, #e74c3c); color: #fff; }
.ys-session-btn-logout { background: var(--border-color, #e0e0e0); color: var(--text-color, #2c3e50); }

/* Form doğrulama stilleri */
.form-control.is-valid,
.ys-input-valid {
    border-color: #27ae60 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2327ae60' stroke-width='2'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}
.form-control.is-invalid,
.ys-input-invalid {
    border-color: #e74c3c !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23e74c3c' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}
.form-feedback {
    font-size: 0.78rem;
    margin-top: 4px;
    padding-left: 2px;
}
.form-feedback.valid   { color: #27ae60; }
.form-feedback.invalid { color: #e74c3c; }

/* Şifre gücü göstergesi */
.password-strength-bar {
    height: 4px;
    border-radius: 4px;
    margin-top: 6px;
    transition: width 0.3s, background 0.3s;
    width: 0%;
}
.password-strength-bar.weak   { width: 33%; background: #e74c3c; }
.password-strength-bar.medium { width: 66%; background: #f39c12; }
.password-strength-bar.strong { width: 100%; background: #27ae60; }
.password-strength-label { font-size: 0.76rem; margin-top: 3px; }
.password-strength-label.weak   { color: #e74c3c; }
.password-strength-label.medium { color: #f39c12; }
.password-strength-label.strong { color: #27ae60; }
