/* Global Box Sizing */
* {
    box-sizing: border-box;
}

/* Base Body Styles - Consolidated (from style2.css) */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    color: #000000;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    padding-top: 70px !important;
}

/* 4. Header (Mobile First) */
h1.thumbnail-link2 {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    background-color: #ffffff;
    border: 1px solid #000;
    box-shadow: 4px 4px 0 #000000, 8px 8px 0 #FF10F0;
    padding: 12px 20px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
}

h1.thumbnail-link2 img {
    height: 1.5em;
    width: auto;
}


.input-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 340px;
    width: 100%;
    margin: 10px auto;
    align-items: center;
}

/* Buttons */
#btnGet,
#btnReset,
#btnCopy {
    font-size: 1rem;
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 12px 18px;
    background-color: #000;
    color: #fff;
    cursor: pointer;
    transition: 0.3s;
    min-width: 120px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

#btnCopy {
    background-color: #fff;
    color: #000;
    display: none;
}

/* Hover effects */
#btnGet:hover,
#btnReset:hover {
    background-color: #ffffff;
    color: #000000;
}

#btnCopy:hover {
    background-color: #000;
    color: #fff;
}

input[type="text"] {
    width: 100%;
    max-width: 340px;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    border: 2px solid #000000;
    outline: none;
    color: #000;
    margin-bottom: 10px;
    background-color: #ffffff;
    text-align: center;
}

input[type="text"]::placeholder {
    color: #666666;
}

.btn {
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #000000;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: #000000;
    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;
    color: #000000;
}

#outputBox {
    display: none;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 10px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #000000;
    color: #000000;
    text-align: center;
    word-break: break-word;
    min-height: 64px;
    font-size: 15px;
}

.note {
    font-size: 0.95rem;
    margin: 15px 20px 20px;
    color: #000000;
    max-width: 600px;
    width: 90%;
    line-height: 1.5;
    background: #ffffff;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid #000000;
}

.thumbnail-link2 img {
    width: 80px;
    height: 80px;
    margin-right: 8px;
    vertical-align: middle;
}

.thumbnail-link2 {
    display: inline-flex;
    align-items: center;
    color: #000000;
}

/* Tablet Media Query - Desktop Layout */
@media (min-width: 640px) {
    h1.thumbnail-link2 {
        flex-direction: row;
        font-size: 2rem;
        padding: 15px 30px;
    }

    /* Desktop: Use space-between to align buttons Left/Right */
    .input-wrap {
        justify-content: space-between;
    }

    .btn {
        width: auto;
        min-width: 160px;
    }
}

/* Sections */
section {
    margin-bottom: 24px;
    width: 100%;
}

ul {
    list-style-position: inside;
    padding: 0;
}

a {
    text-decoration: none;
    color: #0077ff;
}

a:hover {
    text-decoration: underline;
}

@media (min-width: 1024px) {
    h1.thumbnail-link2 {
        font-size: 2.5rem;
    }
}

/* Professional CSS Components */
.loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    width: 100%;
    grid-column: 1 / span 2;
}

.spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-circle {
    width: 100%;
    height: 100%;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #000;
    border-radius: 50%;
    position: absolute;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#percent-text {
    font-weight: bold;
    font-size: 18px;
    color: #000;
    z-index: 10;
}

#copy-notice {
    display: none;
    background: #333;
    color: #fff;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-active {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 15px;
}

@media (max-width: 480px) {
    .grid-active {
        grid-template-columns: 1fr !important;
    }
}

.kw-item {
    background: #f9f9f9;
    padding: 8px 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kw-text span {
    color: #ff0000;
    font-weight: bold;
    margin-right: 8px;
}

.remove-btn {
    background: #eee;
    color: #888;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.remove-btn:hover {
    background: #ff0000;
    color: #fff;
}

.no-tags-error {
    color: #ff0000;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    border: 2px dashed #ff0000;
    border-radius: 8px;
    background: #fff5f5;
    animation: shakePulse 0.6s ease-in-out;
}

@keyframes shakePulse {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }

    50% {
        scale: 1.05;
    }
}

#copy {
    font-size: 1rem;
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 12px 18px;
    cursor: pointer;
    transition: 0.3s;
    background-color: #000;
    color: #fff;
    display: block;
    margin: 20px auto;
    font-weight: bold;
}

#copy:hover {
    background-color: #000;
    color: #fff;
}

/* Mobile Specific (Phones) */
@media (max-width: 600px) {

    /* Stack buttons one after another on mobile by controlling .input-wrap and button widths */
    .input-wrap {
        flex-direction: column;
    }

    #btnGet,
    #btnReset,
    #btnCopy {
        padding: 14px 10px;
        font-size: 0.9rem;
        /* Replaced width 100% with auto/max-width to avoid edge touching if that's the "left and right" issue */
        width: 90%;
        margin: 5px auto;
    }
}