/* General Body and Typography */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: #fff; /* Default background */
    color: #333;
    line-height: 1.6;
    scroll-behavior: smooth;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: #F50057; /* Vibrant pink */
    color: #fff;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

.app-layout.logged-out-view .sidebar {
    display: none; /* Hide sidebar when logged out */
}

.sidebar-profile {
    text-align: center;
    padding: 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    box-sizing: border-box;
}

.sidebar-profile img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-bottom: 10px;
    object-fit: cover;
}

.sidebar-profile h3 {
    margin: 5px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.sidebar-profile p {
    margin: 3px 0;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.8);
    word-break: break-all; /* Prevent long emails/IDs from breaking layout */
}

.sidebar-nav {
    width: 100%;
    margin-top: 20px;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #fff;
    text-decoration: none;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s ease, padding-left 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i {
    width: 25px;
    margin-right: 15px;
    font-size: 1.1em;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    padding-left: 28px;
}

.sidebar-nav .nav-link.active-link {
    background-color: rgba(0, 0, 0, 0.15);
    border-left: 3px solid #fff;
    font-weight: 600;
    padding-left: 25px;
}

/* Main Content Area Styling */
.main-content {
    flex-grow: 1;
    margin-left: 260px; /* Default margin for when sidebar is visible */
    padding: 30px;
    background-color: #f4f6f9; /* Light grey background for content */
    min-height: 100vh;
    box-sizing: border-box;
    transition: margin-left 0.3s ease-in-out;
}

.app-layout.logged-out-view .main-content {
    margin-left: 0; /* No margin when sidebar is hidden */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Card Styling */
.card {
    background: #fff;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    opacity: 1;
    transition: opacity 0.4s ease-in-out, transform 0.3s ease-in-out;
    width: 100%;
    max-width: 700px; /* Max width for content cards */
}

.app-layout.logged-out-view #auth-section.card {
     margin-bottom: 0; /* No bottom margin for auth card when it's centered */
     /* It will be the only card visible in this view */
}

.card.hidden {
    display: none !important; /* Important to ensure it's hidden */
    opacity: 0;
    transform: translateY(10px);
}

.card h2 {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 12px;
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
    font-weight: 600;
}

.profile-sub-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.profile-sub-section h3 {
    font-size: 1.2em;
    color: #444;
    margin-bottom: 15px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    margin-top: 10px;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.btn i { font-size: 1.1em; }

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}
.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn.primary-alt {
    background: #0779e4; color: #fff;
}
.btn.primary-alt:hover { background: #055bb5; }

.btn.secondary-alt {
    background: #6c757d; color: #fff;
}
.btn.secondary-alt:hover { background: #5a6268; }

.btn.danger-alt {
    background: #dc3545; color: #fff;
}
.btn.danger-alt:hover { background: #c82333; }

.btn:disabled, .btn.disabled {
    background-color: #adb5bd; color: #6c757d;
    cursor: not-allowed; transform: none; box-shadow: none; opacity: 0.7;
}

/* Input fields */
input[type="text"], input[type="email"], input[type="password"], select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box;
}

/* Utility & Footer Text */
.footer-text {
    font-size: 0.85em; color: #6c757d; margin-top: 15px; text-align: center;
}
.footer-text a { color: #0779e4; text-decoration: none; }
.footer-text a:hover { text-decoration: underline; }

.cooldown { color: #e74c3c; font-weight: bold; margin-top: 10px; font-size: 0.9em; }

/* Shop & Coin Packages */
#shop-items-list {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px;
}
.shop-item {
    padding: 15px; background: #fdfdfd; border-left: 4px solid #0779e4;
    border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.shop-item h3 { font-size: 1.1em; color: #2c3e50; margin-bottom: 5px;}
.shop-item p { font-size: 0.85em; color: #555; margin: 4px 0;}
.shop-item p code { background-color: #e9ecef; padding: 2px 4px; border-radius: 3px; }

#coin-packages {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px;
}
.coin-package {
    background: #f8f9fa; padding: 20px; border-radius: 6px;
    text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.coin-package h3 { font-size: 1.15em; color: #2c3e50; }
.coin-package p { font-size: 0.9em; margin-bottom: 12px; }
.coin-package .btn { width: 100%; }

/* Message Box */
.message-box-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6); display: flex;
    justify-content: center; align-items: center; z-index: 2000;
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.message-box-overlay.visible { opacity: 1; visibility: visible; }
.message-box-content {
    background-color: #fff; padding: 25px 30px; border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25); text-align: center;
    max-width: 90%; width: 380px; transform: scale(0.95);
    transition: transform 0.3s ease;
}
.message-box-overlay.visible .message-box-content { transform: scale(1); }
.message-box-content h3 { margin-top: 0; color: #333; font-size: 1.3em; }
.message-box-content p { margin-bottom: 20px; color: #555; font-size: 1em;}
.message-box-content .btn { margin-top: 5px; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .app-layout:not(.logged-out-view) .sidebar {
        /* Example: Could be a slide-out menu triggered by a button */
        /* For simplicity, we'll stack it on top if visible */
        width: 100%; height: auto; position: static;
        padding-bottom: 10px;
    }
    .app-layout:not(.logged-out-view) .main-content {
        margin-left: 0; /* Full width when sidebar stacks or is hidden */
    }

    /* When logged out on mobile, sidebar is display:none, main-content already takes full width */
    .app-layout.logged-out-view .main-content {
        justify-content: flex-start; /* Align auth card to top on mobile */
        padding-top: 30px;
    }

    .card h2 { font-size: 1.3em; }
    .btn { padding: 10px 15px; font-size: 0.9em; }
}

@media (max-width: 480px) {
    .sidebar-profile h3 { font-size: 1.1em; }
    .sidebar-profile p { font-size: 0.75em; }
    #shop-items-list, #coin-packages { grid-template-columns: 1fr; }
}

