/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Mobile Device Message */
.mobile-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    padding: 12px 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: none;
}

.mobile-message-content {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    font-size: 14px;
    line-height: 1.4;
}

.mobile-message-content svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.mobile-message-content span {
    flex: 1;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.mobile-message-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.mobile-message-close:hover {
    opacity: 1;
}

@media (min-width: 769px) {
    .mobile-message {
        display: none !important;
    }
}

/* Promotional Banner Styles */
.main-banner {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0 5px 0; /* Reduced top and bottom margins for better spacing */
}

.promotional-banner {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Hamburger Menu Styles */
.hamburger-menu {
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    z-index: 1002 !important;
}

.hamburger-icon {
    width: 32px;
    height: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hamburger-icon:hover {
    transform: scale(1.1);
}

.hamburger-icon span {
    width: 20px;
    height: 2px;
    background-color: #666;
    margin: 2px 0;
    transition: all 0.3s ease;
    display: block;
}

.hamburger-dropdown {
    position: fixed;
    top: 60px;
    left: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 150px;
    display: none;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    z-index: 1002;
}

.hamburger-dropdown.show {
    display: block;
}

.hamburger-dropdown a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.hamburger-dropdown a:hover {
    background-color: #f5f5f5;
}

.hamburger-dropdown a.nav-lesson {
    font-weight: 600;
}

.hamburger-dropdown a.nav-indent {
    padding-left: 32px;
    font-weight: 400;
}

/* User Menu Styles */
.user-menu {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 1000 !important;
}

.user-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-icon:hover {
    transform: scale(1.1);
}

.user-icon svg {
    color: #666;
}

.user-dropdown {
    position: fixed;
    top: 60px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    display: none;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.user-info {
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.user-info span {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.dropdown-divider {
    height: 1px;
    background-color: #e9ecef;
}

.dropdown-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item svg {
    color: #666;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: white;
    color: #333;
    line-height: 1.6;
    padding: 20px 20px 100px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.container {
    max-width: 1200px;
    width: 100%;
    background-color: white;
    padding: 30px 30px 0 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

/* Index page specific desktop adjustments */
@media (min-width: 769px) {
    .index-page .logo-section {
        flex: 0 0 400px !important;
        margin-right: 120px !important;
    }
    
    .index-page .instruction {
        font-size: 32px !important;
    }
}

.logo-section {
    flex: 1;
    min-width: 300px;
}

.logo {
    margin-bottom: 10px;
}

.logo-image {
    max-height: 60px;
    width: auto;
    display: block;
}

.tagline {
    font-size: 14px;
    color: #000;
}

.series-info {
    text-align: center;
    flex: 1;
    min-width: 300px;
    margin-left: -300px;
}

.series-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.instruction {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #d32f2f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    white-space: normal;
    margin-left: -80px;
}

/* Main Image Section */
.main-image {
    margin: 10px 0;
    text-align: center;
}

.mahjong-tiles-image {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Footer Styles */
.page-number {
    position: fixed;
    bottom: 42px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: #666;
    z-index: 100;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

#pageNumberText {
    display: inline-block;
}

.page-number-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4caf50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 8px;
    flex-shrink: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.footer {
    margin-top: 30px;
    text-align: center;
    flex: 1;
}

.community-info {
    margin-bottom: 15px;
}

.community-info p {
    font-size: 16px;
    color: #000;
}

.social-media {
    margin-bottom: 15px;
}

.social-media p {
    font-size: 16px;
    color: #000;
    font-weight: 400;
}

.contact {
    margin-bottom: 20px;
}

.contact p {
    font-size: 16px;
    color: #000;
    font-weight: 400;
}

.fine-print {
    margin-top: 20px;
    padding: 15px 30px;
    background-color: white;
}

.fine-print p {
    font-size: 10px;
    color: #666;
    line-height: 1.4;
    margin: 0;
    text-align: center;
}

.button-container {
    margin-top: 0px;
    padding: 15px 30px 30px 30px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background-color: white;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    min-height: 60px;
    height: auto;
}

.footer-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.back-btn {
    background-color: #f5f5f5;
    color: #333;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background-color: #e9e9e9;
}

.login-btn {
    background-color: #4caf50;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-player {
    margin-right: 15px;
}

@media (max-width: 768px) {
    .audio-player {
        width: 100%;
        min-width: 100%;
        order: 1;
        margin-bottom: 10px;
    }
    
    .audio-player audio {
        width: 100%;
        height: 48px;
        min-height: 48px;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}


.disclaimer p {
    font-size: 10px;
    color: #666;
    line-height: 1.4;
    flex: 0 0 60%;
    margin: 0;
    max-width: 60%;
    text-align: left;
}


.login-btn:hover {
    background-color: #45a049;
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
    background-color: #4caf50;
}

.back-btn:active {
    transform: translateY(0);
    background-color: #e0e0e0;
}

/* Authentication Modal */
.auth-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.auth-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* Contact Support Modal */
.contact-support-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
}

.contact-support-content {
    background-color: white;
    padding: 40px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    position: relative;
    text-align: center;
    margin: auto;
    flex-shrink: 0;
    transform: translateY(100px);
}

.contact-support-info {
    margin: 20px 0;
}

.contact-email-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
    transition: background-color 0.3s ease;
}

.contact-email-box:hover {
    background-color: #e9ece9;
}

.contact-email-box a:hover {
    color: #45a049;
}

.contact-support-close-btn {
    width: 100%;
    padding: 12px 24px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.contact-support-close-btn:hover {
    background-color: #45a049;
}

.contact-support-close-btn:active {
    transform: translateY(1px);
}

.auth-content h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

.auth-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

.auth-content input:focus {
    outline: none;
    border-color: #4caf50;
}

.auth-content button {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-content button:first-of-type {
    background-color: #4caf50;
    color: white;
}

.auth-content button:first-of-type:hover {
    background-color: #45a049;
}

.auth-content button:not(:first-of-type) {
    background-color: #f5f5f5;
    color: #333;
}

.auth-content button:not(:first-of-type):hover {
    background-color: #e0e0e0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px 10px 100px 10px;
    }
    
    .container {
        padding: 20px 20px 0 20px;
    }
    
    .main-banner {
        margin-top: 60px;
    }
    
    .page-number {
        bottom: 12px;
    }
    
    /* Index page specific - no extra spacing */
    .index-page .header {
        margin-bottom: 15px !important;
        padding-top: 50px !important;
    }
    
    .index-page .main-image {
        margin-top: 0px !important;
        margin-bottom: 10px !important;
    }
    
    .index-page .series-info {
        margin-top: 5px !important;
        margin-bottom: 0px !important;
    }
    
    .index-page .instruction {
        margin-bottom: 0px !important;
        text-align: center !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        font-size: 20px !important;
    }
    
    .index-page .series-title {
        font-size: 20px !important;
        text-align: center !important;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .series-info {
        text-align: center;
        margin-top: 20px;
        margin-left: 0;
    }
    
    .modern {
        font-size: 20px;
    }
    
    .mahjong {
        font-size: 28px;
    }
    
    .series-title {
        font-size: 16px;
        text-align: center;
    }
    
    .instruction {
        font-size: 18px;
        white-space: normal;
        text-align: center;
        margin-left: 0;
    }
    
    
    .button-container {
        padding: 15px 20px 30px 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px 10px 100px 10px;
    }
    
    .container {
        padding: 15px 15px 0 15px;
    }
    
    .button-container {
        padding: 10px 15px 15px 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .audio-player {
        width: 100%;
        min-width: 100%;
        order: 1;
    }
    
    .footer-buttons {
        order: 2;
        display: flex;
        gap: 10px;
        width: 100%;
    }
    
    .footer-buttons button {
        flex: 1;
    }
    
    .series-info {
        margin-left: 0;
    }
    
    .modern {
        font-size: 18px;
    }
    
    .mahjong {
        font-size: 24px;
    }
    
    .button-container {
        padding: 12px 15px 30px 15px;
        gap: 10px;
    }
    
    .disclaimer p {
        max-width: 70%;
        font-size: 9px;
        line-height: 1.3;
    }
    
    .series-title {
        font-size: 14px;
        text-align: center;
    }
    
    .instruction {
        font-size: 18px;
        white-space: normal;
        text-align: center;
        margin-left: 0;
    }
    
    .tagline {
        font-size: 12px;
    }
}

/* Audio Callout Styles */
.audio-callout {
    position: fixed;
    bottom: 120px;
    left: 20px;
    z-index: 1001;
    max-width: 500px;
    width: calc(90% - 40px);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.audio-callout-content {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 20px 40px 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Speech bubble pointer pointing down */
.audio-callout-pointer {
    position: absolute;
    bottom: -10px;
    left: 40px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid rgba(0, 0, 0, 0.85);
}

.audio-callout-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    opacity: 0.9;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.audio-callout-close:hover {
    opacity: 1;
}

.audio-callout-icon {
    font-size: 32px;
    text-align: center;
    margin-bottom: 10px;
}

.audio-callout-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.audio-callout-content p {
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    font-family: 'Inter', sans-serif;
    opacity: 0.95;
}

/* Mobile styles for audio callout */
@media (max-width: 768px) {
    .audio-callout {
        bottom: 150px;
        left: 10px;
        width: calc(95% - 20px);
    }
    
    .audio-callout-content {
        padding: 16px 35px 26px 16px;
    }
    
    .audio-callout-content h3 {
        font-size: 18px;
    }
    
    .audio-callout-content p {
        font-size: 13px;
    }
    
    .audio-callout-icon {
        font-size: 28px;
    }
}

/* Navigation Menu Callout Styles */
.nav-callout {
    position: fixed;
    top: 60px;
    left: 20px;
    z-index: 1001;
    max-width: 300px;
    width: calc(90% - 40px);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-callout-content {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 20px 40px 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Speech bubble pointer pointing up to hamburger menu */
.nav-callout-pointer {
    position: absolute;
    top: -12px;
    left: 10px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid rgba(0, 0, 0, 0.85);
}

.nav-callout-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    opacity: 0.9;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.nav-callout-close:hover {
    opacity: 1;
}

.nav-callout-icon {
    text-align: center;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-callout-icon svg {
    width: 32px;
    height: 32px;
}

.nav-callout-content h3 {
    font-size: 18px;
    margin-bottom: 10px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.nav-callout-content p {
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    font-family: 'Inter', sans-serif;
    opacity: 0.95;
}

/* Mobile styles for navigation callout */
@media (max-width: 768px) {
    .nav-callout {
        top: 50px;
        left: 10px;
        width: calc(90% - 20px);
        max-width: 280px;
    }
    
    .nav-callout-content {
        padding: 16px 35px 26px 16px;
    }
    
    .nav-callout-content h3 {
        font-size: 16px;
    }
    
    .nav-callout-content p {
        font-size: 13px;
    }
    
    .nav-callout-icon {
        font-size: 28px;
    }
    
    .nav-callout-pointer {
        top: -12px;
        left: 8px;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .page-number {
        position: static;
        transform: none;
        margin: 15px auto 0 auto;
        bottom: auto;
        left: auto;
    }
}