/**
 * Galileo - Kelime Tooltip Stilleri
 */

/* Tooltip ile sarılmış kelimeler */
.g-tip {
    cursor: help;
    /* color: #fff; */
    transition: all 0.2s ease;
    /* background: #000; */
    padding: 0px 4px 2px 4px;
    /* border-radius: 5px; */
    border-bottom: 2px solid #E91E63;
}

.g-tip:hover,
.g-tip:focus {
    background-color: rgb(108 108 108);
    outline: none;
    color: #fff;
}

/* Floating Popup */
.g-pop {
    position: fixed;
    z-index: 10000;
    min-width: 200px;
    max-width: 320px;
    background: #4e4e4e;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    font-size: 14px;
    line-height: 1.5;
}

.g-pop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.g-pop.hide {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
}

/* Arrow */
.g-pop::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #4e4e4e;
    transform: rotate(45deg);
    left: var(--arrow-left, 50%);
    margin-left: -6px;
}

.g-pop[data-place="top"]::before {
    bottom: -6px;
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.08);
}

.g-pop[data-place="bottom"]::before,
.g-pop.arrow-top::before {
    top: -6px;
    box-shadow: -3px -3px 6px rgba(0, 0, 0, 0.08);
}

/* Content */
.g-pop-content {
    padding: 12px 16px;
    padding-right: 32px;
}

/* Close Button */
.g-pop-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.g-pop-close:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Word Title */
.g-pop-word {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.g-pop-link {
    font-weight: 600;
    font-size: 16px;
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}

.g-pop-link:hover {
    color: #fbd433;
    text-decoration: underline;
}

.g-pop-type {
    font-size: 11px;
    padding: 2px 8px;
    background: #fff;
    color: #000;
    border-radius: 20px;
    font-weight: 500;
}

/* Meaning */
.g-pop-meaning {
    color: #fff;
    margin-bottom: 6px;
}

/* Description */
.g-pop-desc {
    font-size: 13px;
    color: #fff;
    padding-top: 6px;
    border-top: 1px solid #f3f4f6;
}

/* Empty & Error States */
.g-pop-empty,
.g-pop-error {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 8px 0;
}

.g-pop-error {
    color: #ef4444;
}

/* Loading */
.g-pop-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #000;
    padding: 8px 0;
}

.g-pop-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: g-spin 0.8s linear infinite;
}

@keyframes g-spin {
    to { transform: rotate(360deg); }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .g-tip {
        border-bottom-color: #818cf8;
    }

    .g-tip:hover,
    .g-tip:focus {
        background-color: rgba(129, 140, 248, 0.15);
    }

    .g-pop {
        background: #1f2937;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    }

    .g-pop::before {
        background: #1f2937;
    }

    .g-pop-close {
        background: #374151;
        color: #9ca3af;
    }

    .g-pop-close:hover {
        background: #4b5563;
        color: #f3f4f6;
    }

    .g-pop-link {
        color: #fff;
    }

    .g-pop-link:hover {
        color: #fbd433;
    }

    .g-pop-type {
        background: #fff;
        color: #000;
    }

    .g-pop-meaning {
        color: #fff;
    }

    .g-pop-desc {
        color: #fff;
        border-top-color: #374151;
    }

    .g-pop-spinner {
        border-color: #374151;
        border-top-color: #818cf8;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .g-pop {
        max-width: calc(100vw - 32px);
        min-width: 180px;
    }

    .g-pop-content {
        padding: 10px 14px;
        padding-right: 28px;
    }

    .g-pop-link {
        font-size: 15px;
    }
}
