/*
 * Front‑end styles for the InpockLink theme.
 *
 * These styles are intentionally minimal and mobile‑friendly.  They use
 * flexbox and responsive units to ensure a pleasant experience on small
 * screens.  Feel free to tweak colours and spacing to match your brand.
 */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #e2f0ef;
    color: #333;
}

/*
 * Apply border-box sizing globally. This ensures padding and border are included in the width
 * calculations for all elements, preventing overflow on small screens and simplifying responsive
 * layouts.
 */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Scrolling banner at top */
.scroll-banner {
    overflow: hidden;
    background-color: #f5d17f;
    color: #815a00;
    white-space: nowrap;
    width: 100%;
}

/*
 * Continuous scrolling text implementation.
 *
 * The .scroll-text element displays the message plus a pause (10 NBSPs) once. A CSS ::after
 * pseudo-element duplicates the content four times. The entire string then animates leftwards
 * by 25% of its width, which equates to the width of one copy. Because the string repeats
 * seamlessly, the animation loops smoothly without any reset or jump.  Increasing the number
 * of repetitions or adjusting the translate value will alter the pacing.
 */
.scroll-text {
    display: inline-block;
    white-space: nowrap;
    padding: 8px 0;
    /* The animation duration determines the scroll speed. 30s yields a slow, readable crawl. */
    animation: scroll-left 30s linear infinite;
}

/* Duplicate the text four times to provide ample content for the animation to scroll through.  The
 * data-text attribute on the element contains the message and NBSP separator which is repeated
 * here.  Adjust the number of repetitions and the translation percentage in @keyframes scroll-left
 * together: four repetitions require a -25% shift for a seamless loop. */
.scroll-text::after {
    content: attr(data-text) attr(data-text) attr(data-text) attr(data-text);
}

@keyframes scroll-left {
    from { transform: translateX(0); }
    to   { transform: translateX(-25%); }
}

/* Profile section */
.profile-section {
    text-align: center;
    padding: 20px 10px;
}

.profile-image {
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.profile-name {
    margin: 10px 0 5px;
    font-size: 24px;
    font-weight: bold;
}

.profile-id {
    font-size: 18px;
    color: #555;
}

/* Tagline shown below the profile ID.  Smaller, subtle text allowing emoji */
.profile-tagline {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
    white-space: pre-wrap;
}

.contact-button {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.contact-button:hover {
    background-color: #f1f1f1;
}

/* Search bar container with a light yellow background */
.search-container {
    background-color: #fff8e1;
    padding: 20px 10px;
    border-radius: 16px;
    /* Match the width of the product cards (95% of the page with max‑width 600px) so the search bar aligns visually */
    width: 95%;
    max-width: 600px;
    /* Do not set horizontal margins here.  The parent flex container (.items-list) centres its children via
     * align-items: centre.  A bottom margin alone provides spacing below the search bar without causing a
     * width mismatch. */
    margin-bottom: 12px;
    text-align: center;
    /* Ensure padding is included in the width to prevent overflow on small screens */
    box-sizing: border-box;
}

/* Wrapper to position the icon inside the input */
.search-wrapper {
    position: relative;
    margin-bottom: 10px;
}

/* Search input field */
#search-input {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 10px 16px 10px 40px;
    font-size: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    background-color: #ffffff;
    outline: none;
}

/* Placeholder color */
#search-input::placeholder {
    color: #aaa;
}

/* Magnifying glass icon constructed with CSS */
.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 50%;
}

.search-icon::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 2px;
    background: #ccc;
    top: 8px;
    left: 10px;
    transform: rotate(45deg);
}

/* Hint text underneath the search input */
.search-hint {
    /* Center hint text within the search area. Using flex ensures multi‑line text remains centered regardless of container width */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.search-hint p {
    margin: 4px 0;
    font-size: 14px;
    color: #666;
}

.search-hint p strong {
    color: #e67e22;
    font-weight: bold;
}

/* Displayed when no items match the search query */
.no-results {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 8px 0 12px;
}

/* Items list */
.items-list {
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.link-card {
    display: flex;
    align-items: center;
    width: 95%;
    max-width: 600px;
    background-color: #fff;
    border-radius: 16px;
    margin-bottom: 12px;
    padding: 10px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.1s ease;
}

.link-card:hover {
    transform: translateY(-2px);
}

.link-card img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    margin-right: 12px;
}

.link-card .link-number {
    font-weight: bold;
    /* Add extra left margin to create additional spacing between the thumbnail and the number.
     * Users requested roughly four character spaces of blank area. On most mobile devices this
     * equates to about 20px total when combined with the thumbnail margin. We set the
     * left margin to 0.5rem (~8px) so with the thumbnail’s 12px margin-right the total
     * gap approximates four spaces. Adjust this value as needed for your design. */
    /* Provide a margin corresponding to roughly four space characters (approx 32px total) between the image and the
     * start of the numbered label. We remove the right margin so the product title appears immediately after the
     * number. */
    margin-left: 20px;
    margin-right: 0;
}

.link-card .link-title {
    /* The title should follow directly after the number. Remove flex grow and centering so the
     * label appears next to the number rather than being centred across the card. */
    margin-left: 4px;
    font-size: 16px;
    font-weight: 500;
}

/* Combined number and title label. It appears after the thumbnail with appropriate spacing. */
.link-card .link-label {
    margin-left: 20px; /* leave roughly four space characters after the image */
    font-size: 16px;
    font-weight: 500;
    color: inherit;
}

/* Modal styles */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 20px;
}

.modal-content label {
    display: block;
    margin-top: 10px;
}

.modal-content input[type="text"],
.modal-content textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.modal-content button[type="submit"] {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #2a9d8f;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-content button[type="submit"]:hover {
    background-color: #238b7e;
}

/* Responsive typography tweaks */
@media (min-width: 600px) {
    .profile-name {
        font-size: 28px;
    }
    .profile-id {
        font-size: 20px;
    }
    .link-card img {
        width: 70px;
        height: 70px;
    }
    .link-card .link-title {
        font-size: 18px;
    }
}