/* ==========================================================================
   MAHJONG HAND HELPER - CONSOLIDATED STYLES
   ========================================================================== */

/* ==========================================================================
   1. BASE / RESET STYLES
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2d5016 0%, #1a3a0f 100%);
    min-height: 100vh;
    padding: 20px;
}

/* ==========================================================================
   2. CONTAINER & LAYOUT
   ========================================================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* ==========================================================================
   3. HEADER STYLES
   ========================================================================== */

header {
    background: #eafff7    ;
    padding: 20px 30px;
    text-align: center;
}

header img.logo {
    max-width: 100%;
    height: auto;
    max-height: 145px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* ==========================================================================
   4. NAVIGATION BAR
   ========================================================================== */

.nav-bar {
    background:  #678d5a;
    padding: 10px 30px;
    display: flex;
    gap: 20px;
}

.nav-bar a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.2s;
    font-weight: 600;
}

.nav-bar a:hover {
    background: rgba(255,255,255,0.1);
}

.nav-bar a.active {
    background: #2d5016;
}

.nav-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.auth-nav-button {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: inherit;
    transition: all 0.2s;
}

.auth-nav-button:hover {
    background: rgba(255,255,255,0.25);
}

.auth-nav-button.get-started {
    background: white;
    color: #2d5016;
    border: 2px solid white;
    font-weight: 600;
}

.auth-nav-button.get-started:hover {
    background: #e8f4ee;
    border-color: #e8f4ee;
}

/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active {
    visibility: hidden;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #2d5016 0%, #1a3a0f 100%);
    z-index: 1000;
    padding: 70px 20px 20px;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1em;
    transition: background 0.2s;
    margin-bottom: 5px;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    background: rgba(255, 255, 255, 0.15);
}

.mobile-menu .mobile-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 15px 0;
}

.mobile-menu .mobile-auth-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-menu .auth-nav-button {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
}

.mobile-menu .mobile-user-info {
    color: white;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 10px;
}

.mobile-menu .mobile-user-email {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 5px;
    word-break: break-all;
}

.mobile-menu .tier-badge {
    display: inline-block;
}

/* Mobile Menu Close Button */
.mobile-menu-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
}

/* Responsive - Show hamburger on small screens */
@media (max-width: 768px) {
    .hamburger-btn {
        display: block;
    }
    
    .mobile-menu,
    .mobile-menu-overlay {
        display: block;
    }
    
    .nav-links {
        display: none;
    }
    
    .nav-right {
        display: none;
    }
    
    .nav-bar {
        justify-content: flex-end;
    }
    
    body.mobile-menu-open {
        overflow: hidden;
    }
}

/* ==========================================================================
   5. FOOTER STYLES
   ========================================================================== */

.site-footer {
    background: linear-gradient(135deg, #1a3a0f 0%, #0f2409 100%);
    color: white;
    padding: 40px 30px 20px;
    margin-top: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.footer-section h4 {
    color: #8bc34a;
    font-size: 1em;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section p {
    color: rgba(255,255,255,0.7);
    font-size: 0.9em;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: #8bc34a;
}

.footer-bottom {
    max-width: 1200px;
    margin: 30px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-copyright {
    font-size: 0.85em;
    opacity: 0.7;
}

.footer-legal-links {
    display: flex;
    gap: 20px;
}

.footer-legal-links a {
    color: white;
    text-decoration: none;
    font-size: 0.85em;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.footer-legal-links a:hover {
    opacity: 1;
}

/* ==========================================================================
   6. COMMON COMPONENTS
   ========================================================================== */

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #2d5016;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #3d6b1e;
    transform: translateY(-3px);
}

/* Upgrade Banner */
.upgrade-banner {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.upgrade-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.upgrade-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.upgrade-text {
    flex: 1;
    color: #1565c0;
}

.upgrade-text strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 4px;
    color: #0d47a1;
}

.upgrade-text span {
    font-size: 0.9em;
    opacity: 0.9;
}

.upgrade-button {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.upgrade-button:hover {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.upgrade-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.upgrade-login-text {
    color: #1565c0;
    font-size: 0.9em;
}

.upgrade-login-link {
    color: #1565c0;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}

.upgrade-login-link:hover {
    color: #0d47a1;
}

/* Common Button Styles */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: #2d5a27;
    color: white;
}

.btn-primary:hover {
    background: #1e3d1a;
}

.btn-secondary {
    background: #e9ecef;
    color: #333;
}

.btn-secondary:hover {
    background: #dee2e6;
}

.btn-danger {
    background: #fff5f5;
    color: #dc3545;
    border: 1px solid #f5c6cb;
}

.btn-danger:hover {
    background: #dc3545;
    color: white;
}

/* Alert Styles */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.alert-info {
    background: #e7f3ff;
    border: 1px solid #b6d4fe;
    color: #0c4a8f;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert svg {
    flex-shrink: 0;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2d5016;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state svg {
    color: #ccc;
    margin-bottom: 16px;
}

/* ==========================================================================
   7. RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 768px) {
    .nav-bar {
        padding: 10px 15px;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 15px 20px;
    }
    
    header img.logo {
        max-height: 60px;
    }
}

