/* ========== THEME SWITCH ========== */

.theme-switch {
    position: fixed;
    left: 20px;
    bottom: 20px;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 14px;

    background: transparent;
    color: #6b7280;

    border-radius: 14px;
    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;

    z-index: 1000;
    user-select: none;
}

.theme-switch:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #111827;
}

body.dark .theme-switch {
    color: #d1d5db;
}

body.dark .theme-switch:hover {
    background: rgba(255, 255, 255, 0.06);
}

.theme-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;

    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;

    background: #ffffff;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
}

body.dark .theme-icon {
    background: #2a2a2a;
    color: #d1d5db;
    border: 1px solid #3a3a3a;
}

.theme-switch:hover .theme-icon {
    transform: scale(1.05);
}

.theme-text {
    font-size: 14px;
    opacity: 0.9;
}

.switch {
    width: 42px;
    height: 22px;
    border-radius: 999px;
    position: relative;
    transition: background 0.25s ease;
    background: #e5e7eb;
}

.switch-handle {
    width: 18px;
    height: 18px;
    border-radius: 50%;

    position: absolute;
    top: 2px;
    left: 2px;
    background: #ffffff;

    transition: transform 0.25s ease, background 0.25s ease;
}

body.dark .switch {
    background: #059669;
}

body.dark .switch-handle {
    transform: translateX(20px);
    background: #ffffff;
}

.theme-switch:hover .switch {
    filter: brightness(1.05);
}

/* ========== SCROLL TO TOP ========== */

.scroll-top {
    position: fixed;
    right: 28px;
    bottom: 76px;

    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;

    background: rgba(5, 150, 105, 0.1);
    color: #059669;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        background 0.2s ease;

    z-index: 999;

    box-shadow:
        inset 0 0 0 1px rgba(5, 150, 105, 0.12),
        0 6px 18px rgba(0, 0, 0, 0.12);
}

/* visible */
.scroll-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-top:hover {
    background: rgba(5, 150, 105, 0.18);
    transform: translateY(-2px);
}

.scroll-top::before {
    content: "";
    position: absolute;

    width: 10px;
    height: 10px;

    border-left: 3px solid currentColor;
    border-top: 3px solid currentColor;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%) rotate(45deg);
    transform-origin: center;
}

.scroll-top:hover::before {
    transform: translate(-50%, -55%) rotate(45deg);
}

body.dark .scroll-top {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;

    box-shadow:
        0 0 0 rgba(0, 0, 0, 0);
}

body.dark .scroll-top:hover {
    background: rgba(52, 211, 153, 0.2);
    box-shadow:
        0 8px 20px rgba(52, 211, 153, 0.2);
}

/* ========== SITE CREDIT ========== */

.site-credit {
    position: fixed;
    right: 24px;
    bottom: 18px;
    z-index: 20;

    display: flex;
    align-items: center;
    gap: 14px;

    font-size: 13px;
    color: #475569;
}

.credit-text {
    white-space: nowrap;
}

.credit-icons {
    display: flex;
    gap: 10px;
}

.credit-icons a {
    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;
    transition: background .2s ease, transform .2s ease;
    color: #6b7280;
}

.credit-icons a:hover {
    background: rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.credit-icons svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* SVG Icons Fix */
.credit-icons svg,
.credit-icons svg path {
    fill: currentColor;
}

body.dark .credit-icons a {
    color: #d1d5db;
}

body.dark .credit-icons a:hover {
    color: #ffffff;
}

/* ===== TERMS LINK ===== */

.terms-link {
    font-size: 13px;
    color: inherit;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.2s ease, text-decoration 0.2s ease;
}

.terms-link:hover {
    text-decoration: underline;
    opacity: 0.85;
}

body.dark .terms-link {
    color: inherit;
}

/* ========== SOCIAL ICONS DARK MODE ========== */

body.dark .social-icon {
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
}

body.dark .social-icon img,
body.dark .social-icon svg {
    filter: invert(1) brightness(0.9);
}
