/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-gradient-start: #387e8e;
    --bg-gradient-end: #387e8e;
    --container-bg: #4fb3c9;
    --button-bg: #30889c;
    --button-hover: #287180;
    --button-shadow: #1b4d58;
    --button-border: #215966;
    --text-primary: #1a1a1a;
    --text-white: #ffffff;
    --border-radius: 16px;
    --button-radius: 12px;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px 0;
}

body.modal-open {

    overflow: hidden;

}



/* Container */

.container {

    max-width: 680px;

    margin: 0 auto;

    padding: 20px 20px 40px;

    background: var(--container-bg);

    border-radius: var(--border-radius);

    backdrop-filter: blur(10px);

    position: relative;

}



/* Header */
.header {
    position: relative;
    min-height: 150px; /* Adjust as needed */
    margin-bottom: 20px;
}

.floating-header-container {
    position: absolute;
    top: 50px; /* Moved further down */
    left: 15%;
    display: flex;
    align-items: center;
    gap: 16px;
    transform: translateX(-15%);
}

.logo.floating-logo {
    width: 110px;
    height: 110px;
    margin-bottom: 0;
    animation: float-anim 6s ease-in-out infinite;
}

.dialog-box {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: 12px;
    position: relative;
    max-width: 400px; /* Made wider */
    font-family: 'Kanit', sans-serif;
    font-size: 16px;
    line-height: 1.4;
    border: 2px solid var(--button-border);
    box-shadow: 3px 3px 0px 0px var(--button-shadow);
}

.dialog-box::after, .dialog-box::before {
	content: '';
	position: absolute;
	width: 0;
	height: 0;
	border-style: solid;
}

/* This is the border of the tail */
.dialog-box::before {
	top: 20px;
	right: 100%;
	border-width: 12px;
	border-color: transparent var(--button-border) transparent transparent;
}

/* This is the fill of the tail */
.dialog-box::after {
	top: 22px; /* 20px base + 2px border */
	right: 100%;
    margin-right: 2px; /* Push left by 2px to reveal border */
	border-width: 10px;
	border-color: transparent rgba(255, 255, 255, 0.9) transparent transparent;
}

.dialog-box p {
    margin: 0;
}

@keyframes float-anim {
    0% { transform: translate(0, 0); }
    25% { transform: translate(2px, 5px); }
    50% { transform: translate(-3px, -2px); }
    75% { transform: translate(3px, -5px); }
    100% { transform: translate(0, 0); }
}

/* Top Controls */

.top-controls {

    position: absolute;

    top: 16px;

    right: 16px;

    z-index: 100;

    display: flex;

    gap: 8px;

    align-items: center;

}



.back-button {

    position: absolute;

    top: 16px;

    left: 16px;

    z-index: 100;

}



.back-button button,

.country-button,

.share-button button {

    background: rgba(255, 255, 255, 0.85);

    border: none;

    border-radius: 50%;

    width: 48px;

    height: 48px;

    display: flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

    box-shadow: 0 2px 8px var(--shadow);

    transition: transform 0.2s, box-shadow 0.2s;

    backdrop-filter: blur(10px);

    color: var(--text-primary);

}



.back-button.hidden {

    display: none;

}



.back-button button:hover,

.country-button:hover,

.share-button button:hover {

    transform: scale(1.05);

    box-shadow: 0 4px 12px var(--shadow);

}



/* Country Selector */

.country-selector {

    position: relative; /* Changed from absolute */

}



#countryFlag {

    width: 28px;

    height: 28px;

    border-radius: 50%;

    object-fit: cover;

}



.country-dropdown {

    position: absolute;

    top: 56px;

    right: 0; /* Align to the right of the parent */

    background: white;

    border-radius: 8px;

    box-shadow: 0 4px 16px var(--shadow);

    min-width: 56px;

    overflow: hidden;

    padding: 4px 0;

}



.country-dropdown img {

    width: 24px;

    height: 18px;

    border-radius: 2px;

    object-fit: cover;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);

}



.country-dropdown button {

    width: 100%;

    padding: 6px 0;

    border: none;

    background: white;

    text-align: center;

    cursor: pointer;

    transition: background 0.2s;

    display: flex;

    align-items: center;

    justify-content: center;

}



.country-dropdown button:hover {

    background: #f5f5f5;

}



.country-dropdown.hidden {

    display: none;

}



/* Share Button */

.share-button {

    position: relative; /* Changed from absolute */

}



/* Links Container */

.links-container {

    margin-bottom: 30px;

}



/* Content Page Styles */

.content-page {

    background: #fff;

    border-radius: var(--border-radius);

    padding: 24px;

    color: #333;

    border: 2px solid var(--button-border);

    box-shadow: 3px 3px 0px 0px var(--button-shadow);

}



.content-page h2 {

    font-family: 'Kanit', sans-serif;

    font-size: 24px;

    margin-bottom: 16px;

    color: #1a1a1a;

}



.content-page p,

.content-page li {

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;

    font-size: 16px;

    line-height: 1.7;

}



.content-page ul {



    padding-left: 20px;



    margin-top: 12px;



    margin-bottom: 12px;



}







.content-image {







    max-width: 154px; /* Reduced by 30% */







    width: 100%; /* Ensure responsiveness within max-width */







    display: block;







    margin: 20px auto;







    border-radius: var(--border-radius);







    /* Removed box-shadow and border */







}







/* Section */



.section {



    margin-bottom: 32px;



}



.section-title {

    font-family: 'Kanit', sans-serif;

    font-size: 18px;

    font-weight: 700;

    text-align: center;

    color: var(--text-primary);

    margin-bottom: 16px;

}



/* Category & Link Buttons */

.category-item,

.link-item {

    background: var(--button-bg);

    border-radius: var(--button-radius);

    border: 2px solid var(--button-border);

    padding: 18px 12px; /* Unify padding */

    margin-bottom: 12px;

    display: flex;

    align-items: center;

    gap: 12px;

    cursor: pointer;

    transition: all 0.2s ease;

    text-decoration: none;

    color: var(--text-white);

    box-shadow: 3px 3px 0px 0px var(--button-shadow);

    position: relative;

    width: 100%;

    text-align: left;

    font-size: inherit;

}



.category-item {

    justify-content: space-between;

}



.link-item--pseudo-category {

    justify-content: space-between;

}



.category-item .link-title {

    font-family: 'Kanit', sans-serif;

    font-size: 18px;

    font-weight: 700;

}



.category-item:after,

.link-item--pseudo-category::after {

    content: '›';

    font-size: 28px;

    font-weight: bold;

    color: rgba(255, 255, 255, 0.7);

}



.link-item--pseudo-category::after {

    visibility: hidden; /* Make the arrow invisible but still take up space */

}





.category-item:hover,

.link-item:hover {

    background: var(--button-hover);

    transform: translate(1px, 1px);

    box-shadow: 2px 2px 0px 0px var(--button-shadow);

}



.category-item:active,

.link-item:active {

    transform: translate(2px, 2px);

    box-shadow: 1px 1px 0px 0px var(--button-shadow);

}



.link-thumbnail {

    width: 48px;

    height: 48px;

    border-radius: 8px;

    object-fit: cover;

    background: white;

    padding: 4px;

    flex-shrink: 0;

}



.link-content {

    flex: 1;

    min-width: 0;

}



.link-title {







    font-family: 'Kanit', sans-serif; /* Apply Kanit font */







    font-size: 18px; /* Match category title font size */







    font-weight: 700;







    color: var(--text-white);







    white-space: nowrap;







    overflow: hidden;







    text-overflow: ellipsis;







}



.link-price {

    font-size: 13px;

    color: rgba(255, 255, 255, 0.85);

}



.link-menu {

    display: none;

}



/* Social Links */

.social-links {

    display: flex;

    justify-content: center;

    gap: 16px;

    margin: 32px 0;

}



.social-icon {

    color: var(--text-primary);

    transition: transform 0.2s, color 0.2s;

}



.social-icon:hover {

    transform: scale(1.1);

    color: #000;

}



/* Email Signup */

.email-signup {

    background: rgba(255, 255, 255, 0.2);

    border-radius: var(--button-radius);

    padding: 24px;

    margin: 24px 0;

    text-align: center;

}



.email-signup h3 {

    font-size: 20px;

    margin-bottom: 8px;

    color: var(--text-primary);

}



.email-signup p {

    font-size: 14px;

    margin-bottom: 16px;

    color: var(--text-primary);

}



#emailForm {

    display: flex;

    gap: 8px;

    max-width: 400px;

    margin: 0 auto;

}



#emailForm input {

    flex: 1;

    padding: 12px 16px;

    border: none;

    border-radius: 8px;

    font-size: 14px;

}



#emailForm button {

    padding: 12px 24px;

    background: var(--button-bg);

    color: white;

    border: none;

    border-radius: 8px;

    font-weight: 600;

    cursor: pointer;

    transition: background 0.2s;

}



#emailForm button:hover {

    background: var(--button-hover);

}



.email-signup.hidden {

    display: none;

}



/* Footer */

.footer {

    text-align: center;

    margin-top: 40px;

}



.footer-links {

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 8px;

    font-size: 13px;

    color: var(--text-primary);

}



.footer-links a {

    color: var(--text-primary);

    text-decoration: none;

    transition: opacity 0.2s;

}



.footer-links a:hover {

    opacity: 0.7;

}



/* Loading Indicator */

.loading {

    position: fixed;

    top: 0;

    left: 0;

    right: 0;

    bottom: 0;

    background: rgba(0, 0, 0, 0.3);

    display: flex;

    align-items: center;

    justify-content: center;

    z-index: 9999;

}



.loading.hidden {

    display: none;

}



.spinner {

    width: 48px;

    height: 48px;

    border: 4px solid rgba(255, 255, 255, 0.3);

    border-top-color: white;

    border-radius: 50%;

    animation: spin 0.8s linear infinite;

}



@keyframes spin {



    to { transform: rotate(360deg); }



}







@keyframes fadeInUp {



    from {



        opacity: 0;



        transform: translateY(10px);



    }



    to {



        opacity: 1;



        transform: translateY(0);



    }



}







/* Apply animation to newly rendered content */



.category-item,



.section,



.content-page {



    animation: fadeInUp 0.3s ease-out forwards;



}







/* Leaderboard Styles */







.leaderboard-list {







    list-style: none;







    padding: 0;







}















.leaderboard-item {







    display: flex;







    align-items: baseline;







    margin-bottom: 16px;







    font-size: 17px;







    color: #333;







}















.leaderboard-rank,







.leaderboard-score {







    font-weight: bold; /* Make numbers bold */







    flex-shrink: 0;







}















.leaderboard-rank {







    min-width: 35px;







    text-align: right;







    margin-right: 10px;







}















.leaderboard-title {







    font-family: 'Kanit', sans-serif; /* Use the site's header font */







    font-weight: 500;







    flex-grow: 1;







    white-space: nowrap;







    overflow: hidden;







    text-overflow: ellipsis;







    text-decoration: none;







    color: #333;







    margin: 0 10px;







}















.leaderboard-title:hover {







    text-decoration: underline;







}















.leaderboard-score {







    text-align: right;







}















.leaderboard-medal {







    height: 1.2em;







    width: auto;







    vertical-align: -0.2em; /* Adjust vertical alignment */







    margin-right: 10px;







}







/* Responsive Design */







@media (max-width: 768px) {







    .header {







        min-height: 0;







        margin-bottom: 30px;







        margin-top: 0;







    }















    .floating-header-container {







        position: static;







        transform: none;







        flex-direction: column;







        gap: 12px;







        margin-top: 60px; /* Space for top buttons */







    }















        .logo.floating-logo {















            width: 110px; /* Made 25% bigger than 90px */















            height: 110px;















            margin: 0 auto;















        }















        .dialog-box {















            max-width: 100%;















            text-align: center;















        }















    















        .dialog-box::after, .dialog-box::before {















            display: none;















        }















        body {















            padding: 10px 0;















        }















    .container {







        padding: 16px 16px 30px;







        margin: 0 8px;







    }















    .top-controls {







        top: 16px;







        right: 16px;







    }















    .back-button {







        top: 16px;







        left: 16px;







    }















    .back-button button,







    .country-button,







    .share-button button {







        width: 44px;







        height: 44px;







    }















    .link-item,







    .category-item {







        padding: 10px;







    }















    .link-title {







        font-size: 15px;







    }















    .link-price {







        font-size: 12px;







    }















    .link-thumbnail {







        width: 44px;







        height: 44px;







    }















    #emailForm {







        flex-direction: column;







    }















    #emailForm button {







        width: 100%;







    }







}







@media (max-width: 480px) {



    body {



        padding: 8px 0;



    }







    .container {



        border-radius: 12px;



        padding: 12px 12px 24px;



        margin: 0 4px;



    }







    .header {



        margin-top: 40px;



    }







    .top-controls {



        top: 12px;



        right: 12px;



    }







    .back-button {



        top: 12px;



        left: 12px;



    }







        .back-button button,







        .country-button,







        .share-button button {







            width: 40px;







            height: 40px;







        }







    







    /* Leaderboard Specific Styles */







    .leaderboard-header-image {







        max-width: 100%;







        height: auto;







        display: block;







        margin: 0 auto 20px auto;







        border-radius: var(--border-radius);







    }







    







    .leaderboard-list-container {







        margin-top: 20px;







    }







    







    .leaderboard-list {







        list-style: none;







        padding: 0;







        margin: 0;







    }







    







    .leaderboard-item {







        display: flex;







        align-items: center;







        padding: 12px 0;







        border-bottom: 1px solid #eee;







        font-size: 16px;







        line-height: 1.4;







    }







    







    .leaderboard-item:last-child {







        border-bottom: none;







    }







    







    .leaderboard-medal {







        width: 32px;







        height: 32px;







        margin-right: 10px;







        flex-shrink: 0;







    }







    







    .leaderboard-rank {







        font-weight: bold;







        margin-right: 8px;







        color: var(--text-primary);







        width: 25px; /* Fixed width for alignment */







        text-align: right;







    }







    







    .leaderboard-title {







        flex-grow: 1;







        color: var(--button-bg); /* Use a color that stands out but fits theme */







        text-decoration: none;







        font-weight: 600;







        margin-right: 10px;







    }







    







    .leaderboard-title:hover {







        text-decoration: underline;







    }







    







    .leaderboard-score,







    .leaderboard-author {







        font-size: 14px;







        color: #666;







        white-space: nowrap;







        margin-left: 5px;







    }







    







    .leaderboard-score {







        font-weight: bold;







    }







    







    .leaderboard-message {







        text-align: center;







        padding: 20px;







        color: #666;







        font-style: italic;







    }







    







    .section-title {



        font-size: 16px;



    }







    .link-item,



    .category-item {



        padding: 8px;



    }







    .link-thumbnail {



        width: 40px;



        height: 40px;



    }



}
