﻿/* ==========================================================================
   Homepage Dark Tech Style Design - Tiered Investment Product Compatible Version
   ========================================================================== */

:root {
    /* Theme colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a2e1a;
    --bg-card: #1e2a1e;
    --bg-gradient: linear-gradient(135deg, #1a2e1a 0%, #0f1f0f 100%);
    
    /* Green color scheme */
    --primary-green: #00ff88;
    --secondary-green: #00cc6a;
    --accent-green: #33ff99;
    --dark-green: #004d2a;
    
    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    
    /* Gradient effects */
    --gradient-primary: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    --gradient-card: linear-gradient(135deg, #1e2a1e 0%, #2a3a2a 100%);
    --gradient-button: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    
    /* Shadow effects */
    --shadow-neon: 0 0 20px rgba(0, 255, 136, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-button: 0 4px 15px rgba(0, 255, 136, 0.4);
}

/* ==========================================================================
   Page Container
   ========================================================================== */

.page-container {
    min-height: 100vh;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding-bottom: 80px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Header Navigation Area
   ========================================================================== */

.header-section {
    background: var(--bg-gradient);
    padding: 20px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

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

.header-brand {
    flex: 1;
}

.brand-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    text-shadow: var(--shadow-neon);
    font-family: 'Inter', sans-serif;
}

.brand-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    opacity: 0.9;
    font-weight: 400;
}

.brand-logo {
    position: relative;
    display: flex;
    align-items: center;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    filter: drop-shadow(var(--shadow-neon));
}

.logo-glow {
    position: absolute;
    inset: -4px;
    background: var(--gradient-primary);
    border-radius: 12px;
    opacity: 0.3;
    filter: blur(8px);
    z-index: -1;
}

.header-actions {
    display: flex;
    align-items: center;
}

.notification-btn {
    position: relative;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--primary-green);
    transform: translateY(-1px);
}

.notification-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-green);
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* ==========================================================================
   Banner Area
   ========================================================================== */

.banner-section {
    margin: 16px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.banner-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 16px;
}

.banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.banner-item.active {
    opacity: 1;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.banner-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.banner-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-dots .dot.active {
    background: var(--primary-green);
    box-shadow: 0 0 8px var(--primary-green);
}

.default-banner {
    width: 100%;
    height: 100%;
    background: var(--gradient-card);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.banner-title {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 5;
}

.banner-content {
    position: relative;
    z-index: 2;
}

.banner-bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-green) 0%, transparent 70%);
    filter: blur(20px);
    opacity: 0.6;
    animation: float 6s ease-in-out infinite;
}

.orb-1 {
    width: 120px;
    height: 120px;
    top: -20px;
    right: -20px;
}

.orb-2 {
    width: 80px;
    height: 80px;
    bottom: -10px;
    left: -10px;
    animation-delay: 3s;
}

.banner-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-green);
    line-height: 1.2;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.banner-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 16px;
}

.developer-tag {
    background: var(--gradient-button);
    border-radius: 20px;
    padding: 8px 16px;
    margin-top: 16px;
    display: inline-block;
    box-shadow: var(--shadow-button);
}

.developer-text {
    color: var(--bg-primary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* ==========================================================================
   Balance Card Area
   ========================================================================== */

.balance-section {
    padding: 0 16px;
}

.balance-card {
    background: var(--gradient-card);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 136, 0.3);
    box-shadow: var(--shadow-card);
}

.balance-bg-pattern {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 204, 106, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.balance-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.balance-actions {
    margin-left: auto;
}

.balance-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-green);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    margin-top: 4px;
}

.balance-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.action-btn {
    background: var(--gradient-button);
    border: none;
    border-radius: 20px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--bg-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-button);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.6);
}

/* ==========================================================================
   Function Grid Area
   ========================================================================== */

.function-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
}

.grid-item {
    background: var(--gradient-card);
    border-radius: 12px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(0, 255, 136, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
}

.grid-item:hover {
    transform: translateY(-4px);
    border-color: var(--primary-green);
    box-shadow: var(--shadow-neon);
}

.item-icon {
    font-size: 24px;
    filter: grayscale(1) brightness(2);
    transition: all 0.3s ease;
}

.grid-item:hover .item-icon {
    filter: none;
    transform: scale(1.1);
}

.item-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    transition: color 0.3s ease;
}

.grid-item:hover .item-label {
    color: var(--primary-green);
}

.item-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--primary-green) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.grid-item:hover .item-glow {
    opacity: 0.1;
}

/* ==========================================================================
   Product Display Area
   ========================================================================== */

.products-section {
    padding: 24px 16px;
    background: var(--bg-primary);
}

.section-header {
    margin-bottom: 20px;
    text-align: center;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.title-glow-line {
    width: 60px;
    height: 2px;
    background: var(--gradient-primary);
    margin: 0 auto;
    box-shadow: 0 0 8px var(--primary-green);
}

.products-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-card {
    background: var(--gradient-card);
    border-radius: 16px;
    padding: 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 136, 0.2);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.product-card:hover {
    border-color: var(--primary-green);
    box-shadow: var(--shadow-neon);
    transform: translateY(-2px);
}

.product-bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.card-glow-orb {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary-green) 0%, transparent 70%);
    border-radius: 50%;
    top: -20px;
    right: -20px;
    opacity: 0.1;
    filter: blur(15px);
    animation: float 8s ease-in-out infinite;
}

.product-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.product-image-container {
    position: relative;
    width: 48px;
    height: 48px;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.image-glow {
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: 10px;
    opacity: 0.3;
    filter: blur(4px);
    z-index: -1;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================================================
   Product Image Area Styles
   ========================================================================== */

.product-image-section {
    position: relative;
    width: 100%;
    height: 200px;
    margin-bottom: 0;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

.main-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 16px 16px 0 0;
    transition: transform 0.3s ease;
    background-color: #f8f9fa;
}

.product-card:hover .main-product-image {
    transform: scale(1.05);
}

/* ==========================================================================
   Product Information Area Styles
   ========================================================================== */

.product-info-section {
    margin-bottom: 16px;
    padding: 16px 20px 0 20px;
}

.product-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-green);
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}

.product-profit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.profit-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.profit-values {
    font-size: 12px;
    color: var(--primary-green);
    font-weight: 600;
}

.product-period-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.period-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.period-value {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

/* ==========================================================================
   Toggle Details Button Styles - Optimized Version
   ========================================================================== */

.toggle-details-btn {
    width: 120px;
    height: 32px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 16px auto 20px auto;
    position: relative;
    box-shadow: var(--shadow-button);
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
}

.toggle-details-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.toggle-details-btn:hover::before {
    transform: translateX(100%);
}

.toggle-details-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.6);
}

.toggle-details-btn:active {
    transform: translateY(0);
}

.toggle-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    margin-left: 4px;
}

.toggle-details-btn .toggle-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-inverse);
}

/* ==========================================================================
   Extended Area Styles
   ========================================================================== */

.product-details-expanded {
    margin-top: 0;
    padding: 0 20px 20px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 16px 16px;
    border: none;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.product-details-expanded.expanded {
    max-height: 600px;
    opacity: 1;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.detail-card {
    background: var(--gradient-card);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    transition: all 0.3s ease;
}

.detail-card:hover {
    border-color: var(--primary-green);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.2);
}

.detail-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
}

.stage-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.stage-rate {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-green);
    background: rgba(0, 255, 136, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.detail-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.detail-row .label {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-row .value {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 600;
}

.detail-row .value.income {
    color: var(--primary-green);
    font-weight: 700;
}

/* ==========================================================================
   Completed Stage Styles
   ========================================================================== */

.stage-completed {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--primary-green);
}

.stage-status {
    color: var(--primary-green);
    font-size: 16px;
    font-weight: 700;
    margin-left: 8px;
}

/* Keep original stage indicator styles for future use, but not used in new design */

/* ==========================================================================
   Product Information Grid Styles
   ========================================================================== */

.product-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.info-value.highlight {
    color: var(--primary-green);
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}

/* ==========================================================================
   Stage Investment Button Styles
   ========================================================================== */

.stage-invest-btn {
    width: calc(100% - 40px);
    background: var(--gradient-button);
    border: none;
    border-radius: 12px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-button);
    margin: 0 20px;
}

.stage-invest-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.6);
}

.stage-invest-btn:active {
    transform: translateY(0);
}

.stage-invest-btn:disabled {
    background: rgba(128, 128, 128, 0.3);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.stage-invest-btn:disabled:hover {
    transform: none;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 14px;
}

.btn-icon {
    font-size: 16px;
}

.btn-rate {
    color: var(--bg-primary);
    opacity: 0.9;
    font-weight: 700;
}

.btn-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--primary-green) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.stage-invest-btn:hover .btn-glow {
    opacity: 0.2;
}

/* Completed state button */
.stage-invest-btn.completed {
    background: rgba(0, 255, 136, 0.2);
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
}

.stage-invest-btn.completed .btn-content {
    color: var(--primary-green);
}

/* ==========================================================================
   Animation Effects
   ========================================================================== */

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(180deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes glow {
    0%, 100% { box-shadow: var(--shadow-neon); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 136, 0.6); }
}

.glow-animation {
    animation: glow 2s ease-in-out infinite;
}

/* Investment success animation */
@keyframes investSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(0, 255, 136, 0.8); }
    100% { transform: scale(1); }
}

.invest-success-animation {
    animation: investSuccess 2s ease-in-out;
}

.invest-success-animation .stage-indicator.next {
    animation: pulse 0.5s ease-in-out 3;
}

/* Bottom navigation bar styles moved to common.css for unified management */

/* ==========================================================================
   Loading State and Empty Data
   ========================================================================== */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 255, 136, 0.2);
    border-top: 2px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.empty-data {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 16px;
    text-align: center;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .function-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px;
    }
    
    .balance-card {
        margin: 12px;
        padding: 20px;
    }
    
    .balance-amount {
        font-size: 24px;
    }
    
    .banner-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .function-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-item {
        padding: 12px 8px;
    }
    
    .item-label {
        font-size: 11px;
    }
    
    .banner-section {
        margin: 12px;
    }
    
    .banner-container {
        height: 150px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .product-image-section {
        height: 150px;
    }
    
    .products-section {
        padding: 16px 12px;
    }
    
    .detail-card {
        padding: 10px;
    }
    
    .detail-card-header {
        margin-bottom: 8px;
    }
}