/* --- Global Setup & Variables --- */
:root {
    --theme-color: #F1729A;
    --theme-color-dark: #d95a86;
    --text-primary: #333;
    --text-secondary: #777;
    --bg-light: #f7f7f7;
    --bg-white: #ffffff;
    --border-color: #eee;
    --font-family: 'Poppins', sans-serif;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-strong: 0 6px 16px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-light);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Main Layout --- */
.mobile-wrapper {
    max-width: 500px;
    margin: 0 auto;
    background-color: var(--bg-white);
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    padding-bottom: 80px; /* Space for bottom nav */
}

.main-header {
    background: linear-gradient(135deg, var(--theme-color), var(--theme-color-dark));
    color: white;
    padding: 24px;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.9;
}

.user-name {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.user-avatar img {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: var(--shadow);
}

.main-content {
    padding: 24px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 15px;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: -10px;
    margin-bottom: 15px;
}

/* --- Card Component --- */
.card {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-content {
    padding: 20px;
}

.card-content p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.card-content p strong {
    color: var(--text-primary);
}

.link-details {
    color: var(--theme-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 10px;
    display: inline-block;
}

/* --- Specific Card Styles --- */
.status-card {
    display: flex;
    align-items: center;
    padding: 20px;
    border: 2px solid;
}
.status-card.status-active {
    background-color: #e6f9f0;
    border-color: #50d19a;
    color: #0a6c42;
}
.status-card.status-expired {
    background-color: #fff0f0;
    border-color: #f76d6d;
    color: #c92a2a;
}
.status-card .card-icon {
    font-size: 1.5rem;
    margin-right: 15px;
}
.status-card .card-icon svg {
    width: 30px;
    height: 30px;
}
.status-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: inherit;
}
.status-card p {
    color: inherit;
    opacity: 0.8;
}
.status-card .card-arrow {
    margin-left: auto;
    color: inherit;
    opacity: 0.7;
}

.product-card {
    display: flex;
    align-items: center;
}
.product-card-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}
.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-card-content {
    padding: 20px;
}
.product-card-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
}

.event-card {
    border-left: 5px solid var(--theme-color);
}

.download-button {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: var(--bg-light);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: background-color 0.2s;
}
.download-button:hover {
    background-color: #e9e9e9;
}
.download-button svg {
    margin-right: 15px;
    color: var(--theme-color);
}

.box-history-card .box-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}
.box-history-card .box-header span {
    font-size: 0.9rem;
    color: var(--theme-color);
}
.box-history-card p {
    font-size: 0.85rem;
}
.box-history-card .box-products {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}
.box-history-card .box-poster {
    width: 100%;
    margin-top: 15px;
    border-radius: 8px;
}

.product-library-card {
    display: flex;
    align-items: center;
    padding: 15px;
}
.product-library-card img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
    margin-right: 15px;
}
.product-library-content h4 {
    font-size: 1rem;
    font-weight: 600;
}
.product-library-content p {
    font-size: 0.85rem;
    margin-bottom: 5px;
}
.buy-button {
    background-color: var(--theme-color);
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-block;
    transition: background-color 0.2s;
}
.buy-button:hover {
    background-color: var(--theme-color-dark);
}


/* --- Forms --- */
form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: block;
}
form input, form textarea {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-family: var(--font-family);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 15px;
}
form input:disabled {
    background-color: var(--bg-light);
}
form textarea {
    resize: vertical;
}
form .form-message {
    font-size: 0.9rem;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none; /* Hidden by default */
}
form .form-message.success {
    background-color: #e6f9f0;
    color: #0a6c42;
    display: block;
}
form .form-message.error {
    background-color: #fff0f0;
    color: #c92a2a;
    display: block;
}


.button-primary {
    background-color: var(--theme-color);
    color: white;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s;
}
.button-primary:hover {
    background-color: var(--theme-color-dark);
}
.button-danger {
    background-color: #c92a2a;
    color: white;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s;
}
.button-danger:hover {
    background-color: #a62323;
}


/* --- Page Navigation --- */
.page {
    display: none; /* Hidden by default */
}
.page.active {
    display: block; /* Shown when active */
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Bottom Navigation Bar --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 500px;
    margin: 0 auto;
    height: 70px;
    background: var(--bg-white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.03);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 10px;
    transition: color 0.2s;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    margin-bottom: 4px;
}

.nav-item.active {
    color: var(--theme-color);
}

/* --- Loader --- */
.loader-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    display: none; /* Hidden by default */
}
.loader {
    border: 5px solid var(--bg-light);
    border-top: 5px solid var(--theme-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}