/* Investment System Frontend Styles */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 0.5rem;
}

/* Base Styles */
.invest-dashboard,
.invest-profile {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    min-height: 100vh;
}

/* Container */
.invest-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Cards */
.invest-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.invest-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invest-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.invest-card-actions {
    display: flex;
    gap: 0.5rem;
}

.invest-card-body {
    padding: 1.5rem;
}

/* Header */
.invest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.invest-header-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.invest-header-subtitle {
    color: var(--gray-600);
    margin: 0.25rem 0 0 0;
}

.invest-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Stats */
.invest-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.invest-stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius);
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.invest-stat-icon.success {
    background: var(--success-color);
}

.invest-stat-content {
    flex: 1;
}

.invest-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.invest-stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin: 0.25rem 0 0 0;
}

/* Performance */
.invest-performance {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.invest-performance-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.invest-performance-label {
    display: block;
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.invest-performance-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Transactions */
.invest-transactions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.invest-transaction {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.invest-transaction:hover {
    background: var(--gray-100);
    transform: translateX(2px);
}

.invest-transaction-details {
    text-align: right;
}

.invest-transaction-amount {
    font-weight: 600;
    color: var(--gray-900);
}

.invest-transaction-date {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Referral */
.invest-referral {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.invest-referral-input-group {
    display: flex;
    gap: 0.5rem;
}

.invest-referral-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.invest-referral-stat {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.invest-referral-stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success-color);
}

.invest-referral-stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

/* Badges */
.invest-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.invest-badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.invest-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.invest-badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

/* Forms */
.invest-form-group {
    margin-bottom: 1.5rem;
}

.invest-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.invest-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    transition: all 0.2s;
    background: white;
}

.invest-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.invest-help {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Buttons */
.invest-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.invest-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.invest-btn-primary {
    background: var(--primary-color);
    color: white;
}

.invest-btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.invest-btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.invest-btn-outline:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.invest-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Grid System */
.invest-grid {
    display: grid;
    gap: 1.5rem;
}

.invest-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Loading */
.invest-loading-container {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

.invest-loading {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alerts */
.invest-alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.invest-alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.invest-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.invest-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.invest-alert-info {
    background: rgba(37, 99, 235, 0.1);
    color: #1e40af;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.invest-alert a {
    color: inherit;
    text-decoration: underline;
}

/* Mobile First Responsive Design */
@media (max-width: 768px) {
    .invest-container {
        padding: 0.75rem;
    }
    
    .invest-card-header,
    .invest-card-body {
        padding: 1rem;
    }
    
    .invest-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .invest-header-title {
        font-size: 1.5rem;
    }
    
    .invest-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .invest-performance {
        grid-template-columns: 1fr;
    }
    
    .invest-referral-input-group {
        flex-direction: column;
    }
    
    .invest-referral-stats {
        grid-template-columns: 1fr;
    }
    
    .invest-transaction {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .invest-transaction-details {
        text-align: left;
    }
    
    .invest-card-actions {
        flex-wrap: wrap;
    }
    
    .invest-btn {
        font-size: 0.8125rem;
        padding: 0.5rem 1rem;
    }
    
    .invest-btn-sm {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .invest-container {
        padding: 0.5rem;
    }
    
    .invest-card-header,
    .invest-card-body {
        padding: 0.75rem;
    }
    
    .invest-header-title {
        font-size: 1.25rem;
    }
    
    .invest-stat {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .invest-stat-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .invest-stat-value {
        font-size: 1.25rem;
    }
    
    .invest-performance-item {
        padding: 1rem;
    }
    
    .invest-referral-stat {
        padding: 0.75rem;
    }
    
    .invest-transaction {
        padding: 0.75rem;
    }
}

/* Touch-friendly interactions */
@media (hover: none) {
    .invest-btn:hover {
        transform: none;
    }
    
    .invest-transaction:hover {
        transform: none;
        background: var(--gray-50);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .invest-dashboard,
    .invest-profile {
        background: var(--gray-900);
        color: var(--gray-100);
    }
    
    .invest-card {
        background: var(--gray-800);
        border-color: var(--gray-700);
    }
    
    .invest-card-header {
        background: var(--gray-700);
    }
    
    .invest-header-title {
        color: var(--gray-100);
    }
    
    .invest-stat-value {
        color: var(--gray-100);
    }
    
    .invest-transaction {
        background: var(--gray-700);
    }
    
    .invest-transaction:hover {
        background: var(--gray-600);
    }
}
