/* ============================================================
   VS Overlay Panel - Utilities (utilities.css)
   Yardımcı sınıflar, animasyonlar, toast, modal, tooltip
   ============================================================ */

/* --- Info Links (Şifremi Unuttum, Kayıt Ol, Giriş Yap) --- */
.info-links {
    text-align: center;
    max-width: 500px;
    margin: 10px auto 0 auto;
}

/* --- Toast Notification --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 14px 20px;
    background-color: var(--color-surface);
    color: var(--color-text);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--color-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    animation: toast-slide-in 0.3s ease forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-success {
    border-left-color: var(--color-success);
}

.toast-error {
    border-left-color: var(--color-error);
}

.toast-warning {
    border-left-color: var(--color-warning);
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.toast-message {
    flex: 1;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 2px;
    font-size: 1.2rem;
    line-height: 1;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--color-text);
}

.toast-hiding {
    opacity: 0;
    transform: translateX(100%);
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modal-fade-in 0.2s ease;
}

.modal {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modal-scale-in 0.2s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    font-size: 1.5rem;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    background-color: var(--color-bg);
    color: var(--color-text);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border);
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Tooltip --- */
.tooltip-wrapper {
    position: relative;
    display: inline-flex;
}

.tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background-color: var(--color-sidebar-bg);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 100;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--color-sidebar-bg);
}

.tooltip-wrapper:hover .tooltip {
    opacity: 1;
}

/* --- Skeleton Loading --- */
.skeleton {
    background: linear-gradient(90deg, var(--color-border) 25%, #f1f5f9 50%, var(--color-border) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: var(--space-sm);
}

.skeleton-text-sm {
    height: 12px;
    width: 60%;
}

.skeleton-card {
    height: 120px;
    width: 100%;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Visually Hidden (Accessibility) --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* --- Focus Visible (klavye ile gezenler için) --- */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Butonlar için outline offset düzeltmesi */
.btn:focus-visible,
.btn-score:focus-visible,
.btn-flip:focus-visible {
    outline-offset: 2px;
}

/* --- İkon Boyutlandırma --- */
.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 28px; height: 28px; }

/* --- Flex Yardımcıları --- */
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* --- Overflow --- */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* --- Text Overflow --- */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Word Break --- */
.break-all { word-break: break-all; }
.break-word { word-break: break-word; }

/* --- Z-Index Katmanları --- */
.z-dropdown { z-index: 200; }
.z-sticky { z-index: 300; }
.z-modal { z-index: 1000; }
.z-toast { z-index: 9999; }