.light-theme {
    --ctp-rosewater: #dc8a78;
    --ctp-flamingo: #dd7878;
    --ctp-pink: #ea76cb;
    --ctp-mauve: #8839ef;
    --ctp-red: #d20f39;
    --ctp-maroon: #e64553;
    --ctp-peach: #fe640b;
    --ctp-yellow: #df8e1d;
    --ctp-green: #40a02b;
    --ctp-teal: #179299;
    --ctp-sky: #04a5e5;
    --ctp-sapphire: #209fb5;
    --ctp-blue: #1e66f5;
    --ctp-lavender: #7287fd;
    --ctp-text: #4c4f69;
    --ctp-subtext1: #5c5f77;
    --ctp-subtext0: #6c6f85;
    --ctp-overlay2: #7c7f93;
    --ctp-overlay1: #8c8fa1;
    --ctp-overlay0: #9ca0b0;
    --ctp-surface2: #acb0be;
    --ctp-surface1: #bcc0cc;
    --ctp-surface0: #ccd0da;
    --ctp-base: #eff1f5;
    --ctp-mantle: #e6e9ef;
    --ctp-crust: #dce0e8;
    --rp-base: #faf4ed;
    --rp-surface: #fffaf3;
    --rp-overlay: #f2e9e1;
    --rp-muted: #9893a5;
    --rp-subtle: #797593;
    --rp-text: #575279;
    --rp-love: #b4637a;
    --rp-gold: #ea9d34;
    --rp-rose: #d7827e;
    --rp-pine: #286983;
    --rp-foam: #56949f;
    --rp-iris: #907aa9;
    --rp-highlightLow: #f4ede8;
    --rp-highlightMed: #dfdad9;
    --rp-highlightHigh: #cecacd;
    --bg-base: var(--ctp-base);
    --bg-mantle: var(--ctp-mantle);
    --bg-crust: var(--ctp-crust);
    --bg-surface: var(--ctp-surface0);
    --bg-surface-hover: var(--ctp-surface1);
    --text-primary: var(--ctp-text);
    --text-secondary: var(--ctp-subtext1);
    --text-tertiary: var(--ctp-subtext0);
    --text-placeholder: var(--ctp-overlay1);
    --border-color: var(--ctp-surface1);
    --border-color-strong: var(--ctp-surface2);
    --accent-primary: var(--rp-iris);
    --accent-primary-hover: var(--rp-rose);
    --accent-secondary: var(--rp-pine);
    --accent-secondary-hover: var(--rp-foam);
    --accent-tertiary: var(--ctp-sky);
    --accent-tertiary-hover: var(--ctp-sapphire);
    --text-highlight: var(--rp-gold);
    --error-color: var(--rp-love);
    --warning-color: var(--ctp-yellow);
    --success-color: var(--ctp-green);
    --info-color: var(--ctp-blue);
    --button-text-color: var(--rp-base);
    --input-focus-color: var(--accent-primary);
    --shadow-color: rgba(108, 112, 134, 0.15);
    --shadow-color-light: rgba(108, 112, 134, 0.1);
    --modal-bg: rgba(230, 233, 239, 0.85);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    margin: 0;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: auto;
    padding: 30px;
    border-radius: 18px;
    background-color: var(--bg-mantle);
    box-shadow: 0 8px 25px var(--shadow-color);
    transition: background-color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
}

.menu {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: var(--bg-surface);
    display: inline-block;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.menu a:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-hover);
    box-shadow: 0 2px 5px var(--shadow-color-light);
}

.menu a.active {
    color: var(--button-text-color);
    background-color: var(--accent-primary);
    box-shadow: 0 3px 8px var(--shadow-color);
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    text-align: center;
}

.header-icon {
    width: 45px;
    height: 45px;
    margin-right: 15px;
}

h1 {
    color: var(--accent-primary);
    font-size: clamp(1.8rem, 5vw, 2.2rem);
    font-weight: 700;
    margin: 0;
}

.tool-description {
    text-align: center;
    margin-bottom: 25px;
}

.tool-description h2 {
    color: var(--text-secondary);
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 400;
    margin: 0 0 8px 0;
}

.content-area {
    background-color: var(--bg-crust);
    border-radius: 15px;
    padding: 25px;
    margin-top: 0;
    min-height: 120px;
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
    border: 1px solid var(--border-color);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.input-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    text-align: center;
    flex-shrink: 0;
}

.input-section h3 {
    color: var(--accent-secondary);
    font-size: 1.4rem;
    margin: 0 0 10px 0;
    font-weight: 700;
    width: 100%;
}

.input-group {
    flex-grow: 1;
    display: flex;
    align-items: center;
    position: relative;
    background-color: var(--bg-surface);
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.input-group:focus-within {
    border-color: var(--input-focus-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--input-focus-color) 30%, transparent);
}

.input-group .icon-prefix {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 1.1em;
    pointer-events: none;
}

.input-group input[type="text"] {
    flex-grow: 1;
    padding: 14px 15px 14px 45px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

.input-group input[type="text"]::placeholder {
    color: var(--text-placeholder);
    opacity: 1;
}

.paste-button {
    background-color: transparent;
    color: var(--text-tertiary);
    border: none;
    border-left: 1.5px solid var(--border-color);
    padding: 0 15px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    align-self: stretch;
    display: flex;
    align-items: center;
}

.paste-button:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-secondary);
}

#trackUrlButton {
    background-color: var(--accent-primary);
    color: var(--button-text-color);
    border: none;
    padding: 14px 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#trackUrlButton:hover {
    background-color: var(--accent-primary-hover);
    transform: translateY(-1px);
}

#trackUrlButton:active {
    transform: translateY(0);
}

#trackUrlButton:disabled {
    background-color: var(--ctp-overlay0);
    cursor: not-allowed;
    transform: none;
}

.message-area {
    text-align: center;
    padding: 20px 0;
    color: var(--text-secondary);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.message-area .loader {
    width: 30px;
    height: 30px;
    border: 3px solid var(--ctp-surface2);
    border-bottom-color: var(--accent-primary);
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
    margin-bottom: 5px;
}

.message-area p {
    margin: 0;
    font-size: 1rem;
}

.message-area .error {
    color: var(--error-color);
    font-weight: 500;
}

.track-response-display {
    display: none;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background-color: var(--bg-surface);
    border-radius: 10px;
    box-shadow: 0 2px 5px var(--shadow-color-light);
    border: 1px solid var(--border-color);
    flex-grow: 1;
    width: 100%;
    max-width: 500px;
    margin: auto;
}

.info-row {
    display: flex;
    align-items: flex-start;
    width: 100%;
    font-size: 1rem;
    line-height: 1.4;
}

.info-icon {
    color: var(--accent-primary);
    width: 25px;
    text-align: center;
    margin-right: 15px;
    font-size: 1.1rem;
    flex-shrink: 0;
    padding-top: 2px;
}

.info-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 10px;
    flex-shrink: 0;
}

.info-value-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.info-value {
    color: var(--text-primary);
    font-weight: 400;
    word-break: break-word;
}

.user-id-helper {
    font-size: 0.85em;
    color: var(--text-tertiary);
    margin-top: 5px;
    padding-left: 5px;
}

.user-id-helper a {
    color: var(--accent-tertiary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.user-id-helper a:hover {
    color: var(--accent-tertiary-hover);
    text-decoration: underline;
}

.support-message-after-results {
    margin-top: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    text-align: center;
}

.support-message-after-results a {
    font-weight: 500;
    font-size: 1.05rem;
    color: var(--accent-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.support-message-after-results a:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

.credits {
    margin-top: 40px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.6;
}

.credits a {
    color: var(--accent-tertiary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.credits a:hover {
    color: var(--accent-tertiary-hover);
    text-decoration: underline;
}

.credits span {
    color: var(--error-color);
}

#kofi-widget-overlay,
iframe[id^='kofiframe'] {
    z-index: 10001 !important;
}

#themeToggle {
    position: fixed;
    top: 15px;
    right: 15px;
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10002;
    transition: all 0.2s ease;
}

#themeToggle:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
    box-shadow: 0 2px 5px var(--shadow-color-light);
}

@keyframes rotation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 680px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px 15px;
        max-width: 100%;
    }

    .content-area {
        padding: 20px 15px;
    }

    .input-section {
        flex-direction: column;
        gap: 12px;
    }

    .input-group input[type="text"] {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    #trackUrlButton {
        padding-top: 12px;
        padding-bottom: 12px;
        font-size: 1rem;
        width: 100%;
    }
}