* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth transitions for theme switching */
*,
*::before,
*::after {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #22c55e;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #475569;
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --gradient-success: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

/* Light mode specific improvements */
[data-theme="light"] .logo-image {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .stat-card,
[data-theme="light"] .rule-card,
[data-theme="light"] .day-card,
[data-theme="light"] .summary-card,
[data-theme="light"] .settings-panel {
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .day-card.positive {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}

[data-theme="light"] .day-card.negative {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}

[data-theme="light"] .btn {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .theme-toggle-btn {
    background: var(--bg-primary);
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .theme-toggle-btn:hover {
    background: var(--bg-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

/* Enhanced sticky header when scrolled */
.header.scrolled {
    padding: 20px 0;
    box-shadow: var(--shadow-lg);
    border-bottom: 2px solid var(--primary-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.theme-toggle-container {
    display: flex;
    align-items: center;
}

.header-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.logo-image {
    height: 90px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    background: white;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.1;
}

.logo p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    min-width: 140px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Settings Panel */
.settings-panel {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.settings-content {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.setting-group input {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    width: 200px;
    transition: all 0.3s ease;
}

.setting-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Save Settings Button Specific Positioning */
#save-settings {
    margin-top: 25px;
}

/* Theme Toggle */
.theme-toggle-container {
    display: flex;
    align-items: center;
}

.theme-toggle-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.theme-toggle-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.05);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

/* Rules Status */
.rules-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.rule-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.rule-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.rule-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.rule-header i {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.rule-header span:first-of-type {
    flex: 1;
    font-weight: 600;
    font-size: 1.1rem;
}

.rule-status {
    font-size: 1.5rem;
    padding: 5px;
}

.rule-details p {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.rule-details span {
    color: var(--text-primary);
    font-weight: 600;
}

/* Calendar Section */
.calendar-section {
    margin-bottom: 40px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.calendar-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-controls {
    display: flex;
    gap: 12px;
}

.trading-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.day-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.day-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-color);
    transition: all 0.3s ease;
}

.day-card.positive::before {
    background: var(--gradient-success);
}

.day-card.negative::before {
    background: var(--gradient-danger);
}

.day-card.valid-day {
    border-color: var(--success-color);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.day-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.day-number {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.valid-icon {
    color: var(--success-color);
    font-size: 1.2rem;
}

.day-input {
    margin-bottom: 15px;
}

.day-input label {
    display: block;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.profit-input, .notes-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.notes-input {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.profit-input:focus, .notes-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.day-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.profit-display {
    font-weight: 700;
    font-size: 1.2rem;
}

.day-card.positive .profit-display {
    color: var(--success-color);
}

.day-card.negative .profit-display {
    color: var(--danger-color);
}

.percentage-display {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Summary Section */
.summary-section {
    margin-bottom: 40px;
}

.summary-section h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.summary-card h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    font-weight: 500;
}

.summary-card p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    text-align: center;
    color: var(--text-primary);
}

.spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.spinner p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .logo {
        justify-content: center;
    }
    
    .header-stats {
        justify-content: center;
    }
    
    .settings-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .setting-group input {
        width: 100%;
    }
    
    .calendar-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .calendar-controls {
        justify-content: center;
    }
    
    .trading-calendar {
        grid-template-columns: 1fr;
    }
    
    .logo-image {
        height: 50px;
        padding: 6px;
    }

    .logo p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .logo-image {
        height: 40px;
        padding: 5px;
    }
    
    .logo p {
        font-size: 0.9rem;
    }
    
    .stat-card, .summary-card {
        padding: 15px;
    }
    
    .day-card {
        padding: 15px;
    }
    
    .rules-status {
        grid-template-columns: 1fr;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Notification animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Notification styles */
.notification {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transition: all 0.3s ease;
}

.notification-message {
    flex: 1;
    line-height: 1.4;
}

.notification-close {
    transition: all 0.2s ease;
}

.notification-close:hover {
    transform: scale(1.1);
}

/* Success/Error states */
.success {
    color: var(--success-color) !important;
}

.error {
    color: var(--danger-color) !important;
}

.warning {
    color: var(--warning-color) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Profit Split & Withdrawal Section Styles */
.profit-split-section {
    margin-bottom: 40px;
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border-color);
}

.profit-split-section h2 {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.profit-split-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
}

/* Left Side - Profit Distribution */
.profit-distribution-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.total-profit-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    text-align: center;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.2);
    border: none;
    position: relative;
    overflow: hidden;
}

.total-profit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.total-profit-card h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.total-profit-amount {
    font-size: 3rem !important;
    font-weight: 700;
    color: white !important;
    margin: 10px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profit-shares-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.share-card {
    padding: 30px;
    text-align: center;
    background: var(--bg-primary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.3s ease;
}

.share-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.share-card h3 {
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.share-card p {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.trader-share p {
    color: var(--primary-color);
}

.company-share p {
    color: var(--text-muted);
}

.share-percentage {
    margin-top: 20px;
    text-align: center;
    position: relative;
}

.percentage-bar {
    height: 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    position: relative;
    background: var(--bg-secondary);
    overflow: hidden;
}

.percentage-bar.trader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 80%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    animation: fillWidth 1s ease-out;
}

.percentage-bar.company::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, var(--text-muted), var(--text-secondary));
    animation: fillWidth 1s ease-out;
}

@keyframes fillWidth {
    from { width: 0; }
    to { width: 80%; }
}

/* Right Side - Exchange Rate */
.exchange-section .exchange-rate-card {
    height: 100%;
    background: var(--bg-primary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 30px;
    transition: all 0.3s ease;
}

.exchange-rate-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.exchange-rate-header {
    padding-bottom: 25px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.rate-title {
    flex: 1;
}

.rate-title h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.rate-title h3 i {
    color: var(--primary-color);
}

.rate-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.rate-update-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.rate-update-status.success i {
    color: var(--success-color);
}

.rate-input-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    margin-bottom: 25px;
}

.currency-pair {
    display: flex;
    align-items: center;
    gap: 12px;
}

.currency-pair .currency-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.currency-pair i {
    color: var(--primary-color);
    font-size: 1rem;
}

.rate-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-primary);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.rate-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

.rate-input-wrapper input {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
    border: none;
    background: transparent;
    width: 120px;
    text-align: right;
}

.rate-input-wrapper input:focus {
    outline: none;
}

.rate-input-wrapper .currency-code {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.conversion-preview {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.1) 0%, rgba(var(--primary-color-rgb), 0) 100%);
    border-radius: 16px;
}

.conversion-header {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.conversion-result {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: -11px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.conversion-result .currency-symbol {
    font-size: 2rem;
    margin-right: 5px;
    opacity: 0.8;
}

.conversion-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 15px;
}

.conversion-info i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.rate-input-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(var(--primary-color-rgb), 0.05) 0%, rgba(var(--primary-color-rgb), 0) 100%);
    pointer-events: none;
}

.rate-input-group input {
    font-size: 1.4rem;
    font-weight: 700;
    width: 120px;
    text-align: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    color: var(--primary-color);
}

.rate-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.1);
}

.currency-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Withdrawal Calculator */
.withdrawal-calculator {
    grid-column: 1 / -1;
    background: var(--bg-primary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-top: 20px;
}

.calculator-title {
    margin-bottom: 20px;
}

.calculator-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: stretch;
    padding: 30px;
}

.calculator-title {
    margin-bottom: 30px;
    padding: 0 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.calculator-input-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 25px;
    background: var(--bg-secondary);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.calculator-input-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(var(--primary-color-rgb), 0.05) 0%, rgba(var(--primary-color-rgb), 0) 100%);
    pointer-events: none;
}

.amount-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.withdrawal-input {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.withdrawal-input:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.1);
}

.withdrawal-input input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.6rem;
    width: 100%;
    font-weight: 600;
}

.withdrawal-input input:focus {
    outline: none;
}

.withdrawal-input .currency-symbol {
    font-size: 1.4rem;
    color: var(--primary-color);
    font-weight: 600;
}

#calculate-withdrawal {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

#calculate-withdrawal:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(var(--primary-color-rgb), 0.2);
}

.calculator-result-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.calculator-result-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(var(--primary-color-rgb), 0.05) 0%, rgba(var(--primary-color-rgb), 0) 100%);
    pointer-events: none;
}

.conversion-amounts {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
}

.usd-amount {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.conversion-arrow {
    color: var(--primary-color);
}

.bdt-result {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--success-color);
}

.rate-detail {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    display: inline-block;
}

@media (max-width: 1024px) {
    .profit-split-grid {
        grid-template-columns: 1fr;
    }

    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

/* Quick Withdrawal Calculator Styles */
.calculator-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

.withdrawal-result {
    padding: 15px;
}

.conversion-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.conversion-instruction {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.usd-amount {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.conversion-arrow {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.bdt-result {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--success-color);
}

.rate-info {
    text-align: center;
    margin-top: 10px;
}

.rate-detail {
    font-size: 0.9rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 4px 12px;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .withdrawal-section {
        grid-column: span 1;
    }
    
    .conversion-details {
        flex-direction: column;
        gap: 10px;
    }
    
    .conversion-arrow {
        transform: rotate(90deg);
    }
}

/* Login Screen Styles */
.trading-graph {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="30" height="30" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" fill="rgba(255,255,255,0.03)"/></svg>') repeat;
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
}

.login-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.login-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    background: white;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.login-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.login-welcome {
    text-align: center;
    margin-bottom: 30px;
}

.login-welcome h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-welcome p {
    color: var(--text-muted);
    font-size: 1rem;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.login-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 500;
}

.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input input {
    width: 100%;
    padding: 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.password-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

.toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary-color);
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--primary-color-rgb), 0.2);
}

.login-btn:active {
    transform: translateY(0);
}

.market-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-item i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.market-ticker {
    width: 100%;
    max-width: 460px;
    margin-top: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 15px;
    overflow: hidden;
}

.ticker-content {
    display: flex;
    gap: 20px;
    animation: ticker 20s linear infinite;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: var(--bg-primary);
    border-radius: 8px;
    white-space: nowrap;
}

.ticker-item .symbol {
    font-weight: 600;
    color: var(--text-primary);
}

.ticker-item .price {
    color: var(--text-secondary);
}

.ticker-item.positive .change {
    color: var(--success-color);
}

.ticker-item.negative .change {
    color: var(--danger-color);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .market-stats {
        grid-template-columns: 1fr;
    }
    
    .login-logo {
        height: 40px;
    }
    
    .login-welcome h1 {
        font-size: 1.8rem;
    }
}

/* Developer Credit */
.developer-credit {
    margin-top: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.developer-credit:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.developer-credit .company {
    color: var(--primary-color);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.developer-credit .developer {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Conversion Amount Styles */
.conversion-amount {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.conversion-amount::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.conversion-amount:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.conversion-amount:hover::after {
    opacity: 1;
}

.conversion-amount-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.conversion-amount-currency {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.conversion-arrow {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin: 0 10px;
}

/* =============== USER MANAGEMENT STYLES =============== */

/* User Menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-greeting {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.user-dropdown-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown:hover .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 8px;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.dropdown-item.logout {
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
    color: var(--danger-color);
}

.dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Login/Register Form Styles */
.login-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-links {
    text-align: center;
    margin-top: 20px;
}

.register-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.register-link:hover {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

/* Login/Register Form Input Styles - Match Password Field Design */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea {
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input:disabled {
    background: var(--bg-tertiary);
    opacity: 0.7;
    cursor: not-allowed;
}

/* Login Form Specific Styles */
.login-form .form-group input {
    padding: 15px 20px;
    font-size: 1rem;
    border-radius: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.login-form .form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--bg-primary);
}

.login-form .form-group input::placeholder {
    color: var(--text-muted);
}

/* Password Input Wrapper */
.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input input {
    padding-right: 50px !important;
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* Profile Page Styles */
.profile-section {
    margin-top: 20px;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-header h1 {
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.profile-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.profile-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.card-header h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 600;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Form Section Styling */
.form-section-title {
    margin: 25px 0 20px 0;
    padding: 15px 0;
    border-top: 2px solid var(--border-color);
    text-align: center;
}

.form-section-title h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-section-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* Enhanced form styling for configuration */
.profile-form .form-group:has(input[type="number"]) {
    position: relative;
}

.profile-form .form-group:has(input[type="number"]) input {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.profile-form .form-group:has(input[type="number"]) input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--bg-primary);
}

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

/* Back Button */
.back-button {
    margin-right: 20px;
}

.back-button .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stats Grid for Profile */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
}

.stat-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
}

/* Exchange Rate Section Styles */
.exchange-rate-input {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rate-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.rate-update-status {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.rate-update-status.success {
    opacity: 1;
}

.rate-update-status.updating {
    opacity: 1;
    color: var(--warning-color);
}

.rate-update-status.success .status-icon {
    color: var(--success-color);
}

.rate-update-status.updating .status-icon {
    color: var(--warning-color);
}

/* Responsive Design for User Management */
@media (max-width: 768px) {
    .user-menu {
        margin-right: 10px;
    }
    
    .user-greeting {
        display: none;
    }
    
    .profile-content {
        padding: 0 15px;
    }
    
    .profile-card {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .profile-header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
}

/* Profile Switcher */
.profile-switcher {
    position: relative;
    margin-right: 20px;
}

.current-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: white;
}

.current-profile:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.profile-icon {
    font-size: 16px;
}

.profile-name {
    font-weight: 500;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    min-width: 200px;
    width: max-content;
    max-width: 300px;
}

.profile-dropdown.show {
    display: block;
}

/* Hover functionality for profile switcher */
.profile-switcher:hover .profile-dropdown {
    display: block;
}

/* Smooth dropdown transition */
.profile-dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.profile-switcher:hover .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

.profile-option:hover {
    background: #f8fafc;
}

.profile-option.active {
    background: #e0f2fe;
    border-color: #0284c7;
}

.profile-option:last-child {
    border-bottom: none;
}

.profile-info {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.profile-option .profile-name {
    display: block;
    font-weight: 500;
    color: #1e293b;
    font-size: 14px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: visible;
}

.profile-type {
    color: #64748b;
    font-size: 12px;
}

.profile-actions {
    border-top: 1px solid #e2e8f0;
    padding: 8px;
}

.profile-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #475569;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s;
}

.profile-action:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Profile Management Styles */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.profile-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.profile-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

[data-theme="light"] .profile-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.profile-card.active {
    border-color: #0ea5e9;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.15);
}

.profile-card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    border-top: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    background: var(--bg-secondary);
}

.profile-card-header .profile-icon {
    font-size: 20px;
}

.profile-title h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-title .profile-type {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.active-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #059669;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-card-body {
    padding: 16px;
    background: var(--bg-primary);
}

.profile-settings {
    margin-bottom: 16px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-row span {
    color: var(--text-muted);
    font-size: 14px;
}

.setting-row strong {
    color: var(--text-primary);
    font-weight: 600;
}

.profile-meta {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.text-muted {
    color: var(--text-muted);
}

.profile-card-actions {
    padding: 16px;
    background: var(--bg-tertiary);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.active-profile-banner {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.active-profile-banner .profile-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.active-profile-banner .profile-icon {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.9);
}

.active-profile-banner .profile-details h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.active-profile-banner .profile-details p {
    margin: 0 0 8px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.profile-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.profile-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal form {
    padding: 24px;
    background: var(--bg-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-help {
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Page Header Styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    gap: 20px;
}

.page-title h1 {
    margin: 0 0 8px 0;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title p {
    margin: 0;
    color: var(--text-muted);
    font-size: 16px;
}

/* Message Styles */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #059669;
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

[data-theme="dark"] .message.success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

[data-theme="dark"] .message.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Profile Section */
.profile-section {
    padding: 20px;
    min-height: calc(100vh - 120px);
    background: var(--bg-primary);
}

/* Container */
.container {
    background: var(--bg-primary);
    min-height: 100vh;
}

/* User dropdown styles for profiles page */
.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 180px;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown-menu.show,
.user-dropdown:hover .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu .dropdown-item {
    display: block;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.user-dropdown-menu .dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown-menu .dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.user-dropdown-menu .dropdown-item i {
    margin-right: 8px;
    width: 16px;
}

.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.user-dropdown-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
@media (max-width: 768px) {
    .profiles-grid {
        grid-template-columns: 1fr;
    }
    
    .active-profile-banner {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .profile-stats {
        justify-content: space-around;
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .current-profile .profile-name {
        display: none;
    }
    
    .profile-switcher {
        margin-right: 12px;
    }
}

/* Header Navigation Styles */
.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 20px;
}

.header-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.header-nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-nav-link:active {
    transform: translateY(0);
}

.header-nav-link i {
    font-size: 16px;
}

.header-nav-link span {
    font-weight: 500;
}

/* Light theme header nav */
[data-theme="light"] .header-nav-link {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

[data-theme="light"] .header-nav-link:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

/* Responsive header nav */
@media (max-width: 768px) {
    .header-nav {
        gap: 6px;
        margin-right: 12px;
    }
    
    .header-nav-link {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .header-nav-link span {
        display: none;
    }
    
    .header-nav-link i {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .header-nav {
        gap: 4px;
        margin-right: 8px;
    }
    
    .header-nav-link {
        padding: 8px;
        border-radius: 6px;
    }
}

/* Modern Profiles Summary Section */
.profiles-summary-section {
    margin-bottom: 40px;
    padding: 0;
    background: transparent;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    border-radius: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}

.summary-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(50%, -50%);
}

.summary-title h2 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin: 0;
    font-weight: 400;
}

.summary-stats-badge {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px 25px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.profiles-count {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.profiles-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.performance-dashboard {
    display: grid;
    gap: 25px;
    margin-bottom: 40px;
}

.main-metrics {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.metric-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.metric-card.primary-metric {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid var(--primary-color);
    color: #000000;
}

.metric-card.primary-metric .metric-title {
    color: #374151 !important;
}

.metric-card.primary-metric .metric-value .currency,
.metric-card.primary-metric .metric-value .amount {
    color: #000000 !important;
}

.metric-card.primary-metric .trend-text {
    color: #6b7280 !important;
}

.metric-icon {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    flex-shrink: 0;
}

.metric-icon.trophy {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.metric-content {
    flex: 1;
}

.metric-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 8px;
}

.metric-value .currency {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-secondary);
}

.metric-value .amount {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trend-icon {
    font-size: 14px;
    padding: 4px;
    border-radius: 6px;
}

.trend-icon.positive {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.trend-icon.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    transform: rotate(180deg);
}

.trend-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.profit-split-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.split-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.split-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.trader-split {
    border-left: 4px solid var(--success-color);
}

.company-split {
    border-left: 4px solid #6b7280;
}

.split-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.split-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.trader-split .split-icon {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.company-split .split-icon {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.split-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.split-percentage {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.split-amount {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.split-amount .currency {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
}

.split-amount .amount {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Dual Currency Display Styles */
.dual-currency {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    flex-wrap: wrap;
}

.currency-amount {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

.separator {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Total Portfolio Value specific styling */
.metric-card.primary-metric .metric-title {
    color: #000000 !important;
}

.metric-card.primary-metric .currency-amount {
    color: #000000 !important;
}

.metric-card.primary-metric .separator {
    color: #000000 !important;
    opacity: 0.7;
}

/* Dark theme override for Total Portfolio Value */
[data-theme="dark"] .metric-card.primary-metric .metric-title {
    color: #000000 !important;
}

[data-theme="dark"] .metric-card.primary-metric .currency-amount {
    color: #000000 !important;
}

[data-theme="dark"] .metric-card.primary-metric .separator {
    color: #000000 !important;
    opacity: 0.7;
}

[data-theme="dark"] .metric-card.primary-metric .trend-text {
    color: #000000 !important;
}

/* Responsive dual currency for smaller screens */
@media (max-width: 768px) {
    .currency-amount {
        font-size: 24px;
    }
    
    .separator {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .currency-amount {
        font-size: 20px;
    }
    
    .separator {
        font-size: 18px;
    }
}

.profiles-breakdown {
    margin-top: 40px;
}

.breakdown-header {
    margin-bottom: 30px;
    text-align: center;
}

.breakdown-header h3 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.breakdown-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin: 0;
}

.profiles-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.profile-analysis-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.profile-analysis-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.profile-analysis-card.active-profile {
    border: 2px solid var(--success-color);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), rgba(34, 197, 94, 0.02));
}

.profile-card-header {
    margin-bottom: 20px;
}

.profile-name-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.active-indicator {
    color: var(--success-color);
    font-size: 16px;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: var(--success-color);
    color: white;
}

.account-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.size-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
}

.metric-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.metric-item {
    background: rgba(59, 130, 246, 0.05);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.metric-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-value.positive {
    color: var(--success-color);
}

.metric-value.negative {
    color: var(--error-color);
}

.profit-distribution {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.distribution-item {
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.distribution-item.trader {
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.2);
}

.distribution-item.company {
    background: rgba(107, 114, 128, 0.05);
    border-color: rgba(107, 114, 128, 0.2);
}

.dist-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.dist-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-totals {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid var(--border-color);
    color: #000000;
}

.summary-totals .totals-header h4 {
    color: #000000 !important;
}

.summary-totals .total-label {
    color: #374151 !important;
}

.summary-totals .total-value {
    color: #000000 !important;
}

.summary-totals .total-value.primary {
    color: var(--primary-color) !important;
}

.summary-totals .total-value.success {
    color: var(--success-color) !important;
}

.summary-totals .total-value.warning {
    color: #f59e0b !important;
}

.totals-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.totals-header i {
    font-size: 20px;
    color: var(--primary-color);
}

.totals-header h4 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.totals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.total-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    color: #000000;
}

.total-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.total-value {
    font-weight: 800;
    font-size: 16px;
    color: var(--text-primary);
}

.total-value.primary {
    color: var(--primary-color);
}

.total-value.success {
    color: var(--success-color);
}

.total-value.warning {
    color: #f59e0b;
}

.breakdown-table {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr 1.3fr 1.3fr;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 14px;
    padding: 16px 20px;
    gap: 16px;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr 1.3fr 1.3fr;
    padding: 16px 20px;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    align-items: center;
}

.table-row:hover {
    background: rgba(59, 130, 246, 0.05);
}

.table-row:last-child {
    border-bottom: none;
}

.active-profile-row {
    background: rgba(34, 197, 94, 0.08);
    border-left: 4px solid var(--success-color);
}

.total-row {
    background: var(--primary-color-light);
    font-weight: 600;
    border-top: 2px solid var(--primary-color);
}

.profile-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.active-icon {
    color: var(--success-color);
    font-size: 14px;
}

.profile-name {
    color: var(--text-primary);
    font-weight: 500;
}

.active-badge-small {
    background: var(--success-color);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.profit-value {
    font-weight: 600;
}

.profit-value.positive {
    color: var(--success-color);
}

.profit-value.negative {
    color: var(--error-color);
}

.trader-share-value {
    color: var(--success-color);
    font-weight: 600;
}

.total-profit-value,
.total-trader-share {
    color: var(--primary-color);
    font-size: 16px;
}

/* Responsive Design for Modern Summary Section */
@media (max-width: 1024px) {
    .main-metrics {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .profit-split-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .profiles-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .totals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .summary-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
        padding: 25px 20px;
    }
    
    .summary-title h2 {
        font-size: 24px;
    }
    
    .metric-card {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
    }
    
    .metric-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .metric-value .amount {
        font-size: 28px;
    }
    
    .profiles-cards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .metric-row,
    .profit-distribution {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .totals-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .summary-header {
        padding: 20px 15px;
        margin: 0 10px 25px 10px;
        border-radius: 15px;
    }
    
    .summary-title h2 {
        font-size: 20px;
        flex-direction: column;
        gap: 8px;
    }
    
    .summary-subtitle {
        font-size: 14px;
    }
    
    .profiles-count {
        font-size: 24px;
    }
    
    .metric-card {
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .metric-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .metric-value .amount {
        font-size: 24px;
    }
    
    .profile-analysis-card {
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .profile-name {
        font-size: 18px;
    }
    
    .summary-totals {
        padding: 20px 15px;
        margin: 20px 10px 0 10px;
        border-radius: 15px;
    }
}

/* ============ BACKUP & RESTORE STYLES ============ */

.backup-restore-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.backup-section,
.restore-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
}

.backup-section:hover,
.restore-section:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.section-header {
    margin-bottom: 20px;
}

.section-header h4 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.section-header h4 i {
    color: var(--primary-color);
    font-size: 20px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* Backup Section */
.backup-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.info-value {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

/* File Upload Section */
.file-upload-section {
    margin-bottom: 20px;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0.1px;
    height: 0.1px;
    overflow: hidden;
}

.file-input-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-input-label:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.file-input-label i {
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.file-input-label span {
    font-size: 16px;
    font-weight: 500;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--success-color);
    border-radius: 8px;
    margin-top: 12px;
}

.file-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.file-size {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Restore Options */
.restore-options {
    margin-bottom: 25px;
}

.restore-options h5 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.checkbox-label:hover {
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Recent Backups Section */
.recent-backups-section {
    grid-column: 1 / -1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.backups-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.backup-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.backup-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.backup-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.backup-name i {
    color: var(--primary-color);
    font-size: 16px;
}

.backup-details {
    display: flex;
    gap: 15px;
    font-size: 12px;
}

.backup-date {
    color: var(--text-secondary);
}

.backup-size {
    color: var(--text-muted);
}

.backup-actions {
    display: flex;
    gap: 8px;
}

/* Button Styles */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .backup-restore-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .recent-backups-section {
        margin-top: 0;
    }
    
    .backup-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .backup-info,
    .backup-actions {
        align-self: stretch;
    }
    
    .backup-actions {
        justify-content: flex-end;
    }
}

/* Debug Info Section */
.debug-info-section {
    grid-column: 1 / -1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.debug-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.debug-profile-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
}

.debug-profile-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.debug-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.debug-profile-header strong {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.debug-active-badge {
    background: var(--success-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.debug-profile-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.debug-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

.debug-label {
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 150px;
    flex-shrink: 0;
}

.debug-value {
    color: var(--text-primary);
    font-weight: 600;
    flex-grow: 1;
    text-align: right;
}

.debug-value.has-data {
    color: var(--success-color);
}

.debug-value.no-data {
    color: var(--danger-color);
}

.debug-value-path {
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
    word-break: break-all;
    text-align: right;
    flex-grow: 1;
}

/* Enhanced Recent Backups Section */
.recent-backups-section {
    border: 1px solid var(--success-color);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.recent-backups-section .section-header h4 {
    color: var(--success-color);
}

/* Enhanced Backup Info Display */
.backup-info .info-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.backup-info .info-item:last-child {
    border-bottom: none;
}

.backup-info .info-value {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

/* File Upload Enhancement */
.file-input-label {
    border: 2px dashed var(--border-color);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

.file-input-label:hover {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .backup-section,
    .restore-section,
    .recent-backups-section,
    .debug-info-section {
        padding: 20px;
    }
    
    .file-input-label {
        padding: 20px 15px;
    }
    
    .file-input-label i {
        font-size: 24px;
    }
    
    .file-input-label span {
        font-size: 14px;
    }
    
    .backup-name {
        font-size: 13px;
    }
    
    .backup-details {
        flex-direction: column;
        gap: 4px;
    }
    
    .debug-detail-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    .debug-label {
        min-width: auto;
    }
    
    .debug-value,
    .debug-value-path {
        text-align: left;
    }
}
