/* TAJIRO - Loyalty App Style CSS */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark-color);
}

/* Auth Container Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
    text-align: center;
}

.auth-header {
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: 700;
}

.auth-subtitle {
    color: #6b7280;
    font-size: 0.9rem;
}

.auth-form h2 {
    margin-bottom: 25px;
    color: var(--dark-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.sponsor-info {
    background: var(--info-color);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.auth-switch {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.auth-switch p {
    color: #6b7280;
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Main App Styles */
.main-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--light-color);
}

.top-nav {
    background: white;
    padding: 15px 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.user-menu:hover {
    background: var(--light-color);
}

.user-menu i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.dropdown-menu {
    position: absolute;
    top: 70px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--dark-color);
    transition: background-color 0.3s ease;
}

.dropdown-menu a:hover {
    background: var(--light-color);
}

.dropdown-menu a i {
    margin-right: 10px;
    width: 20px;
}

.main-content {
    flex: 1;
    padding: 20px;
    padding-bottom: 80px;
    overflow-y: auto;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    color: var(--dark-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.btn-back {
    padding: 10px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-back:hover {
    background: var(--primary-dark);
}

/* Member Card */
.member-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.member-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-avatar i {
    font-size: 1.8rem;
}

.member-details h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.FREE { background: #6b7280; }
.badge.PAID { background: var(--secondary-color); }
.badge.AGEN { background: var(--warning-color); }

.member-id {
    text-align: right;
}

.member-id small {
    opacity: 0.8;
    font-size: 0.8rem;
}

.card-body {
    padding: 25px 20px;
}

.balance-display {
    text-align: center;
    margin-bottom: 20px;
}

.balance-display small {
    color: #6b7280;
    font-size: 0.9rem;
}

.balance-display h2 {
    color: var(--dark-color);
    font-size: 2rem;
    font-weight: 700;
    margin-top: 5px;
}

.affiliate-code {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
}

.affiliate-code small {
    color: #6b7280;
    font-size: 0.9rem;
}

.code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.btn-copy {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-copy:hover {
    background: var(--primary-dark);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.action-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: block;
}

.action-card span {
    color: var(--dark-color);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Activity Card */
.activity-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.activity-card h3 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.activity-placeholder i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

/* Stats Cards */
.network-stats,
.commission-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.stat-card h3 {
    color: var(--dark-color);
    font-size: 1.3rem;
    font-weight: 700;
}

.stat-card small {
    color: #6b7280;
    font-size: 0.8rem;
}

/* Paket List */
.paket-list {
    display: grid;
    gap: 20px;
}

.paket-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.paket-card:hover {
    transform: translateY(-2px);
}

.paket-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 20px;
    text-align: center;
}

.paket-header h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.paket-price {
    font-size: 1.8rem;
    font-weight: 700;
}

.paket-body {
    padding: 20px;
}

.paket-description {
    color: #6b7280;
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn-beli {
    width: 100%;
    padding: 12px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-beli:hover {
    background: #059669;
}

/* Network Tree */
.network-tree {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    min-height: 200px;
}

.level-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 15px;
    margin-top: 25px;
}

.level-title:first-child {
    margin-top: 0;
}

.member-list {
    display: grid;
    gap: 10px;
}

.member-item {
    background: var(--light-color);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.member-name {
    font-weight: 500;
    color: var(--dark-color);
}

.member-status {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    background: #e5e7eb;
    color: #6b7280;
}

/* Commission List */
.commission-list {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.commission-item {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.commission-item:last-child {
    border-bottom: none;
}

.commission-info {
    flex: 1;
}

.commission-buyer {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 4px;
}

.commission-paket {
    font-size: 0.9rem;
    color: #6b7280;
}

.commission-date {
    font-size: 0.8rem;
    color: #9ca3af;
}

.commission-amount {
    text-align: right;
}

.amount {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* Orders List */
.orders-list {
    display: grid;
    gap: 15px;
}

.order-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.order-paket {
    font-weight: 600;
    color: var(--dark-color);
}

.order-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-PENDING { background: var(--warning-color); color: white; }
.status-MENUNGGU_VERIFIKASI { background: var(--info-color); color: white; }
.status-PAID { background: var(--secondary-color); color: white; }
.status-EXPIRED { background: #6b7280; color: white; }
.status-CANCELLED { background: var(--danger-color); color: white; }

.order-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-size: 0.9rem;
    color: #6b7280;
}

.detail-value {
    font-weight: 500;
    color: var(--dark-color);
}

.order-total {
    border-top: 1px solid #e5e7eb;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-total .detail-label {
    font-weight: 600;
}

.order-total .detail-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    flex: 1;
    text-align: center;
}

.nav-item:hover {
    background: var(--light-color);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item i {
    font-size: 1.2rem;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.loading-spinner p {
    color: #6b7280;
    font-weight: 500;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background: var(--secondary-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.warning {
    background: var(--warning-color);
}

/* QR Code Display */
.qr-container {
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: var(--border-radius);
}

.qr-code {
    width: 200px;
    height: 200px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
}

.qr-code i {
    font-size: 4rem;
    color: #9ca3af;
}

.qr-info {
    margin-bottom: 20px;
}

.qr-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.qr-instructions {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

.countdown {
    background: var(--warning-color);
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
}

.btn-confirm {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.btn-confirm:hover {
    background: var(--primary-dark);
}

.btn-cancel {
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-cancel:hover {
    background: #4b5563;
}

/* Responsive Design */
@media (max-width: 640px) {
    .auth-container {
        padding: 10px;
    }

    .auth-card {
        padding: 30px 20px;
    }

    .main-content {
        padding: 15px;
        padding-bottom: 80px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .network-stats,
    .commission-stats {
        grid-template-columns: 1fr;
    }

    .order-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .modal-content {
        margin: 10px;
    }

    .bottom-nav {
        padding: 8px 0;
    }

    .nav-item span {
        font-size: 0.65rem;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .member-card .card-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .member-info {
        justify-content: center;
    }

    .member-id {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.8rem;
    }

    .balance-display h2 {
        font-size: 1.5rem;
    }

    .action-card {
        padding: 15px;
    }

    .action-card i {
        font-size: 1.5rem;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card i {
        font-size: 1.2rem;
    }

    .stat-card h3 {
        font-size: 1.1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #374151;
        --dark-color: #f3f4f6;
        --border-color: #4b5563;
    }

    body {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    }

    .auth-card,
    .top-nav,
    .dropdown-menu,
    .action-card,
    .activity-card,
    .paket-card,
    .stat-card,
    .member-card,
    .network-tree,
    .commission-list,
    .order-card,
    .modal-content,
    .bottom-nav {
        background: #1f2937;
        color: var(--dark-color);
    }

    .input-with-icon input {
        background: #374151;
        border-color: #4b5563;
        color: var(--dark-color);
    }

    .member-item {
        background: #374151;
    }

    .form-group label {
        color: var(--dark-color);
    }

    .qr-code {
        background: #374151;
        border-color: #4b5563;
    }
}

/* Print Styles */
@media print {
    .top-nav,
    .bottom-nav,
    .btn-back,
    .btn-primary,
    .btn-beli,
    .btn-confirm,
    .btn-cancel {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .auth-container {
        display: none;
    }
}