/* Varlık Yönetimi Sistemi - Ana Stiller */

:root {
    /* Light Theme Colors */
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    
    --border-color: #eee;
    --border-light: #f0f0f0;
    
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.15);
    
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;

    /* Chart Colors */
    --chart-try: #667eea;
    --chart-usd: #48bb78;
    --chart-eur: #ed8936;
    --chart-positive: #28a745;
    --chart-negative: #dc3545;
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --bg-primary: #1a1d29;
    --bg-secondary: #252836;
    --bg-tertiary: #2a2d3e;
    
    --text-primary: #ffffff;
    --text-secondary: #b8bcc8;
    --text-muted: #8b92a9;
    
    --border-color: #3a3d4e;
    --border-light: #2f3349;
    
    --shadow-light: 0 2px 10px rgba(0,0,0,0.3);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.4);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: var(--primary-gradient);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-light);
    position: relative;
    z-index: 10;
    transition: margin-left 0.3s ease;
}

/* Desktop: Header margin when sidebar is visible */
@media (min-width: 769px) {
    .header {
        margin-left: 250px;
    }
}

/* Mobile: No margin */
@media (max-width: 768px) {
    .header {
        margin-left: 0;
    }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile {
    position: relative;
    display: flex;
    align-items: center;
}

.user-profile-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
    min-width: 200px;
    margin-top: 8px;
    display: none;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.user-dropdown-header .username {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.user-dropdown-header .user-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.user-dropdown-menu {
    padding: 0.5rem 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    gap: 0.5rem;
}

.user-dropdown-item:hover {
    background: var(--bg-tertiary);
}

.user-dropdown-item.danger {
    color: var(--danger-color);
}

.user-dropdown-item.danger:hover {
    background: var(--bg-tertiary);
    color: #c82333;
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle-switch.dark {
    background: var(--primary-color);
}

.theme-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.theme-toggle-switch.dark .theme-toggle-slider {
    transform: translateX(26px);
}

/* Update card styles */
.stat-card, .chart-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
}

.asset-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
}

/* Desktop Sidebar Menu */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 5;
    display: none;
    flex-direction: column;
    box-shadow: var(--shadow-medium);
}

.sidebar.show-desktop {
    display: flex;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-gradient);
    color: white;
}

.sidebar-header .sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.sidebar-header .sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    gap: 0.75rem;
    position: relative;
}

.sidebar-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

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

.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--bg-secondary);
}

.sidebar-nav-item .icon {
    width: 20px;
    text-align: center;
}

/* Main content adjustment for desktop with sidebar and mobile bottom nav */
.main-content {
    transition: margin-left 0.3s ease;
    padding-bottom: 80px; /* Space for mobile bottom nav */
}

.main-content.with-sidebar {
    margin-left: 250px;
}

@media (min-width: 769px) {
    .main-content {
        padding-bottom: 0; /* No bottom padding on desktop */
    }
}

/* Mobile responsiveness */
@media (min-width: 769px) {
    .sidebar {
        display: flex;
    }
    
    .main-content {
        margin-left: 250px;
    }
    
    /* Hide bottom navigation on desktop */
    #bottomNav {
        display: none !important;
    }
}

/* Pie Chart Styles */
.chart-section {
    margin: 2rem 0;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-container {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.pie-chart {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, transparent 0deg);
    flex-shrink: 0;
}

.chart-legend {
    flex: 1;
    min-width: 200px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.legend-item:hover {
    background: var(--bg-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-info {
    flex: 1;
}

.legend-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.legend-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.legend-value {
    text-align: right;
    color: var(--text-primary);
}

.legend-percentage {
    font-weight: 600;
    font-size: 0.95rem;
}

.legend-amount {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Mobile chart adjustments */
@media (max-width: 768px) {
    .chart-container {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .pie-chart {
        width: 160px;
        height: 160px;
    }
    
    .chart-legend {
        width: 100%;
        min-width: auto;
    }
}

/* Preferences Modal */
.preferences-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.preferences-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.preferences-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
}

.preferences-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preferences-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preferences-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.preferences-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.preferences-body {
    padding: 1.5rem;
}

.preference-section {
    margin-bottom: 2rem;
}

.preference-section:last-child {
    margin-bottom: 0;
}

.preference-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preference-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.preference-label {
    flex: 1;
}

.preference-label-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.preference-label-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.preference-control {
    margin-left: 1rem;
}

/* Preference Controls */
.pref-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pref-toggle.active {
    background: var(--primary-color);
}

.pref-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.pref-toggle.active .pref-toggle-slider {
    transform: translateX(20px);
}

.pref-select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 120px;
}

.pref-input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 80px;
    text-align: center;
}

.preference-actions {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-preferences {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-preferences:hover {
    background: var(--bg-tertiary);
}

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

.btn-preferences.danger {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

@media (max-width: 768px) {
    .preferences-modal {
        padding: 10px;
    }
    
    .preferences-content {
        max-height: 90vh;
    }
    
    .preference-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .preference-control {
        margin-left: 0;
        align-self: flex-end;
    }
}

.header-logo {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: visible;
}

@media (max-width: 768px) {
    .header-content {
        justify-content: space-between;
        gap: 0.75rem;
    }

    .header-logo {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .header h1 {
        font-size: 1.2rem;
        white-space: normal;
        line-height: 1.3;
    }
}

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

/* Form Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}

.auth-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Alert Styles */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Link Styles */
.auth-link {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Dashboard Styles */
.dashboard-container {
    padding: 2rem 0;
}

.dashboard-header {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 2rem;
    margin-bottom: 2rem;
}

.dashboard-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dashboard-title h2 {
    color: var(--text-primary);
    font-weight: 600;
}

.user-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Loading Styles */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden {
    display: none !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Fix for mobile keyboard and scrolling issues */
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    /* Fix for mobile scrolling and positioning */
    -webkit-overflow-scrolling: touch;
    position: relative;
    margin: auto;
}

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

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close {
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

/* Rate Cards */
.rate-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 0.4rem 0.3rem;
    text-align: center;
    border-left: 4px solid #667eea;
    min-height: 55px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rate-card.gold {
    border-left-color: #ffd700;
}

.rate-card.currency {
    border-left-color: #28a745;
}

.rate-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.1rem;
}

.rate-label {
    color: var(--text-secondary);
    font-size: 0.65rem;
    margin-bottom: 0.1rem;
    line-height: 1.1;
}

.rate-symbol {
    font-size: 1rem;
    margin-bottom: 0.15rem;
}

.rate-updated {
    color: var(--text-muted);
    font-size: 0.65rem;
    line-height: 1;
}

/* Form improvements */
.form-control {
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Assets Grid */
.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.asset-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 1.5rem;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.asset-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.asset-card.currency {
    border-left-color: #28a745;
}

.asset-card.precious_metal {
    border-left-color: #ffd700;
}

.asset-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.asset-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.asset-symbol {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 50%;
}

.asset-card.currency .asset-symbol {
    background: rgba(40, 167, 69, 0.1);
}

.asset-card.precious_metal .asset-symbol {
    background: rgba(255, 215, 0, 0.2);
}

.asset-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.asset-amount {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-icon:hover {
    background: rgba(0,0,0,0.05);
}

.asset-values {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.asset-values > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.asset-values > div:last-child {
    margin-bottom: 0;
}

.asset-values .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.asset-values .value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.profit-loss.profit .value {
    color: #28a745;
}

.profit-loss.loss .value {
    color: #dc3545;
}

.asset-details {
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1rem;
    font-size: 0.85rem;
}

.asset-details .detail-row {
    margin-bottom: 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
}

.asset-details .detail-row.full-width {
    grid-column: 1 / -1;
}

.asset-details .detail-row span:first-child {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    max-width: none;
}

.asset-details .detail-row span:last-child {
    color: var(--text-primary);
    text-align: left;
    margin-left: 0;
    font-weight: 600;
    font-size: 0.85rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    min-height: 20px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-row span:first-child {
    color: var(--text-secondary);
    font-weight: 500;
    flex: 0 0 auto;
    max-width: 45%;
}

.detail-row span:last-child {
    color: var(--text-primary);
    text-align: right;
    flex: 1;
    margin-left: 0.5rem;
    font-weight: 600;
}

.notes {
    font-style: italic;
    word-break: break-word;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .rates-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .rate-card {
        min-height: 50px;
        padding: 0.3rem 0.15rem;
    }

    .rate-symbol {
        font-size: 0.85rem;
        margin-bottom: 0.05rem;
    }

    .rate-value {
        font-size: 0.7rem;
    }
    
    .dashboard-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .modal {
        align-items: flex-start;
        padding: 1rem 0;
    }

    .modal-content {
        width: 95%;
        max-width: none;
        margin: 0 auto;
        /* Prevent horizontal scrolling on mobile */
        overflow-x: hidden !important;
        touch-action: pan-y pinch-zoom;
    }

    .modal-header,
    .modal-body {
        padding: 1rem;
    }
    
    .assets-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .asset-info {
        gap: 0.5rem;
    }
    
    .asset-symbol {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .asset-header {
        align-items: center;
    }
    
    .asset-details {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
    
    .asset-details .detail-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.15rem;
    }
    
    .asset-details .detail-row span:first-child {
        font-size: 0.7rem;
        max-width: 50%;
    }
    
    .asset-details .detail-row span:last-child {
        text-align: right;
        font-size: 0.8rem;
    }
    
    /* Mobile Sticky Bottom Menu */
    body {
        padding-bottom: 70px; /* Space for fixed bottom menu */
    }
    
    #bottomNav {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-top: 1px solid #eee;
        padding: 8px 15px !important;
        margin: 0 !important;
        z-index: 999;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        display: flex !important;
        gap: 6px !important;
        justify-content: center !important;
    }
    
    #bottomNav .nav-btn {
        flex: 1 !important;
        padding: 8px 6px !important;
        font-size: 11px !important;
        min-height: 50px !important;
        max-width: 100px !important;
        border-radius: 8px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        text-decoration: none !important;
        border: none !important;
        background: transparent !important;
        color: #666 !important;
        transition: all 0.2s ease !important;
        cursor: pointer !important;
    }
    
    #bottomNav .nav-btn:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    
    #bottomNav .nav-btn.active {
        background: var(--primary-color) !important;
        color: white !important;
    }
    
    #bottomNav .nav-btn .icon {
        font-size: 18px !important;
        margin-bottom: 2px !important;
    }
    
    #bottomNav .nav-btn .text {
        font-size: 10px !important;
        font-weight: 500 !important;
        line-height: 1 !important;
    }

    /* More Menu Styles */
    #bottomNav .nav-btn-wrapper {
        position: relative;
        flex: 1 !important;
        max-width: 100px !important;
    }

    #bottomNav .more-menu {
        position: absolute;
        bottom: 100%;
        right: 0;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: var(--shadow-medium);
        margin-bottom: 8px;
        min-width: 180px;
        z-index: 1000;
        animation: slideUpFadeIn 0.2s ease;
    }

    @keyframes slideUpFadeIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    #bottomNav .more-menu-item {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        padding: 0.875rem 1rem !important;
        border: none !important;
        background: transparent !important;
        color: var(--text-primary) !important;
        text-decoration: none !important;
        width: 100% !important;
        text-align: left !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        font-size: 0.9rem !important;
        border-bottom: 1px solid var(--border-light) !important;
        max-width: none !important;
        border-radius: 0 !important;
        min-height: auto !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
    }

    #bottomNav .more-menu-item:first-child {
        border-radius: 8px 8px 0 0 !important;
    }

    #bottomNav .more-menu-item:last-child {
        border-bottom: none !important;
        border-radius: 0 0 8px 8px !important;
    }

    #bottomNav .more-menu-item:hover {
        background: var(--bg-tertiary) !important;
        color: var(--primary-color) !important;
    }

    #bottomNav .more-menu-item.active {
        background: rgba(102, 126, 234, 0.1) !important;
        color: var(--primary-color) !important;
        font-weight: 600 !important;
    }

    #bottomNav .more-menu-item .icon {
        font-size: 1.2rem !important;
        width: 24px !important;
        text-align: center !important;
        margin-bottom: 0 !important;
    }

    #bottomNav .more-menu-item .text {
        font-size: 0.9rem !important;
        line-height: 1.2 !important;
        font-weight: 500 !important;
    }
    
    /* Dashboard user info buttons */
    .dashboard-title {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .user-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .user-info button {
        padding: 6px 12px !important;
        font-size: 12px !important;
        margin-left: 0 !important;
        white-space: nowrap;
    }
    
}

/* Version Footer */
.version-footer {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    z-index: 1000;
    font-family: monospace;
    user-select: none;
    pointer-events: none;
    opacity: 0.7;
}

/* Mobile adjustment for version */
@media (max-width: 768px) {
    .version-footer {
        bottom: 85px; /* Above bottom nav (increased to 85px for better visibility) */
        font-size: 8px;
        padding: 2px 5px;
        right: 5px;
        line-height: 1.3;
        max-width: calc(100% - 10px);
    }
}

/* ===================================
   PORTFOLIO CHARTS STYLES
   =================================== */

.charts-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
}

.charts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.charts-header h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.period-selector {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.period-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.period-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-card-header h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.chart-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.chart-change {
    font-size: 0.9rem;
    font-weight: 600;
}

.chart-change.positive {
    color: var(--chart-positive);
}

.chart-change.negative {
    color: var(--chart-negative);
}

.chart-percent {
    font-size: 0.85rem;
    font-weight: 500;
}

.chart-percent.positive {
    color: var(--chart-positive);
}

.chart-percent.negative {
    color: var(--chart-negative);
}

.chart-card canvas {
    width: 100% !important;
    height: 250px !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .charts-section {
        padding: 1rem;
    }

    .charts-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card canvas {
        height: 200px !important;
    }

    .period-selector {
        width: 100%;
        justify-content: space-between;
    }

    .period-btn {
        flex: 1;
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }
}

/* ========================================
   Asset Purchase Tracking Styles
   Grouped/Expanded View for Asset Purchases
======================================== */

/* Asset Group Card (Summary View) */
.asset-group-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.asset-group-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-medium);
}

.asset-group-card.expanded {
    border-color: var(--primary-color);
}

/* Asset Group Header */
.asset-group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    cursor: pointer;
    user-select: none;
}

.asset-group-info {
    flex: 1;
}

.asset-group-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.asset-group-symbol {
    font-size: 2rem;
}

.asset-group-name {
    display: flex;
    flex-direction: column;
}

.asset-group-name h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.asset-group-code {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Asset Group Summary Stats */
.asset-group-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-value.profit {
    color: var(--success-color);
}

.summary-value.loss {
    color: var(--danger-color);
}

/* Asset Group Actions */
.asset-group-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.expand-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.expand-toggle:hover {
    color: var(--primary-color);
}

.expand-toggle.expanded {
    transform: rotate(180deg);
}

/* Purchase List (Expanded View) */
.purchase-list {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.purchase-list.visible {
    max-height: 2000px;
    opacity: 1;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.purchase-item {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--primary-color);
    transition: all 0.2s ease;
}

.purchase-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-light);
}

.purchase-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.purchase-date-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.purchase-item-actions {
    display: flex;
    gap: 0.5rem;
}

.purchase-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.purchase-detail {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-value.profit {
    color: var(--success-color);
}

.detail-value.loss {
    color: var(--danger-color);
}

/* Purchase Notes */
.purchase-notes {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Action Buttons */
.btn-add-purchase {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
}

.btn-add-purchase:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-partial-sale {
    background: var(--warning-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-partial-sale:hover {
    background: #e0a800;
}

/* Inline Action Buttons (in header) */
.btn-add-purchase-inline,
.btn-partial-sale-inline {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-add-purchase-inline:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-partial-sale-inline:hover {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
    transform: translateY(-1px);
}

/* Partial Sale Modal */
.partial-sale-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.partial-sale-modal.show {
    display: flex;
}

.partial-sale-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-medium);
}

.sale-method-selector {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.sale-method-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.sale-method-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.sale-method-btn:hover {
    border-color: var(--primary-color);
}

/* Purchase Selection List */
.purchase-selection-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    margin: 1rem 0;
}

.purchase-selection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.purchase-selection-item:hover {
    border-color: var(--primary-color);
}

.purchase-selection-item.selected {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.purchase-selection-item.will-be-affected {
    border-color: var(--warning-color);
    background: rgba(255, 193, 7, 0.1);
}

/* Realized Profit Display */
.realized-profit-display {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid var(--success-color);
}

.realized-profit-display.loss {
    border-left-color: var(--danger-color);
}

.realized-profit-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.realized-profit-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
}

.realized-profit-value.loss {
    color: var(--danger-color);
}

/* Loading State for Purchase Cards */
.purchase-list-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.purchase-list-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Mobile Responsive for Purchase Tracking */
@media (max-width: 768px) {
    .asset-group-summary {
        grid-template-columns: 1fr;
    }

    .asset-group-actions {
        flex-wrap: wrap;
    }

    .btn-add-purchase-inline,
    .btn-partial-sale-inline {
        font-size: 0.75rem;
        padding: 0.4rem 0.65rem;
    }

    .purchase-details {
        grid-template-columns: 1fr;
    }

    .purchase-item {
        padding: 0.75rem;
    }

    .partial-sale-content {
        padding: 1rem;
        width: 95%;
    }

    .sale-method-selector {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .btn-add-purchase-inline,
    .btn-partial-sale-inline {
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
    }
}

/* ============================================
   CURRENCY CONVERTER STYLES
   ============================================ */

.converter-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.converter-tool {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    margin-bottom: 2rem;
}

.converter-card {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.converter-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.converter-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.converter-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.converter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.converter-input:read-only {
    background: var(--bg-tertiary);
    cursor: not-allowed;
}

.converter-select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.converter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.converter-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.converter-rate {
    font-weight: 600;
    color: var(--primary-color);
}

.converter-updated {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.converter-swap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
}

.converter-swap-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.converter-swap-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(180deg);
    border-color: var(--primary-color);
}

.converter-details {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 2px solid var(--primary-color);
}

.converter-details-header h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.converter-details-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem;
    border-radius: 6px;
    background: var(--bg-tertiary);
}

.detail-row.highlight {
    background: rgba(102, 126, 234, 0.1);
    font-weight: 600;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.quick-presets {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-light);
}

.quick-presets h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
}

.preset-btn {
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.rates-table-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    margin-bottom: 2rem;
}

.rates-table-container h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.rates-table-scroll {
    overflow-x: auto;
}

.rates-table {
    width: 100%;
    border-collapse: collapse;
}

.rates-table thead {
    background: var(--bg-tertiary);
}

.rates-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.rates-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.rates-table tbody tr {
    transition: background 0.2s ease;
}

.rates-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.rate-asset {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rate-icon {
    font-size: 1.5rem;
}

.rate-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.rate-code {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.rate-value {
    font-weight: 600;
    font-size: 1rem;
    color: var(--success-color);
}

.rate-updated {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.currency-row {
    /* Default styling */
}

.gold-row {
    background: rgba(255, 215, 0, 0.05);
}

[data-theme="dark"] .gold-row {
    background: rgba(255, 215, 0, 0.08);
}

/* Responsive Converter Styles */
@media (max-width: 768px) {
    .converter-container {
        padding: 1rem;
    }

    .converter-tool {
        padding: 1.5rem;
    }

    .converter-card {
        padding: 1rem;
    }

    .converter-input-group {
        grid-template-columns: 1fr;
    }

    .converter-input {
        font-size: 1.1rem;
    }

    .converter-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .presets-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .rates-table {
        font-size: 0.9rem;
    }

    .rates-table th,
    .rates-table td {
        padding: 0.625rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .converter-tool {
        padding: 1rem;
        border-radius: 12px;
    }

    .converter-card {
        padding: 0.875rem;
    }

    .converter-input {
        font-size: 1rem;
        padding: 0.75rem;
    }

    .converter-select {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    .presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .preset-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .rates-table {
        font-size: 0.85rem;
    }

    .rate-icon {
        font-size: 1.25rem;
    }

    .rate-name {
        font-size: 0.875rem;
    }
}

/* ============================================
   PROFILE PAGE STYLES
   ============================================ */
.profile-container{max-width:1000px;margin:0 auto;padding:1.5rem}
.profile-content{display:flex;flex-direction:column;gap:2rem}
.profile-section{background:var(--bg-secondary);border-radius:12px;padding:1.5rem;box-shadow:var(--shadow-light)}
.profile-section-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem}
.profile-section-header h3{margin:0;font-size:1.2rem;color:var(--text-primary)}
.btn-edit{padding:0.5rem 1rem;border:none;border-radius:6px;background:var(--primary-color);color:white;cursor:pointer;font-size:0.9rem}
.btn-edit:hover{background:var(--secondary-color)}
.profile-info-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:1.5rem}
.profile-info-item{display:flex;flex-direction:column;gap:0.5rem}
.profile-info-item.full-width{grid-column:1/-1}
.profile-info-item label{font-size:0.875rem;font-weight:600;color:var(--text-secondary)}
.profile-info-value{padding:0.75rem;background:var(--bg-tertiary);border-radius:6px;color:var(--text-primary)}
.profile-input,.profile-textarea{width:100%;padding:0.75rem;border:2px solid var(--border-color);border-radius:6px;background:var(--bg-secondary);color:var(--text-primary);font-family:inherit}
.profile-input:focus,.profile-textarea:focus{outline:none;border-color:var(--primary-color)}
.profile-textarea{resize:vertical;min-height:80px}
.profile-actions{display:flex;gap:1rem;margin-top:1rem}
.password-form{display:flex;flex-direction:column;gap:1rem}
.password-placeholder{padding:2rem;text-align:center;color:var(--text-secondary)}
.form-group{display:flex;flex-direction:column;gap:0.5rem}
.form-group label{font-size:0.875rem;font-weight:600;color:var(--text-secondary)}
.goal-input-group{display:flex;gap:0.5rem}
.goal-input-group input{flex:2}
.goal-input-group select,.profile-select{flex:1;padding:0.75rem;border:2px solid var(--border-color);border-radius:6px;background:var(--bg-secondary);color:var(--text-primary)}
.goal-progress-bar{width:100%;height:8px;background:var(--bg-tertiary);border-radius:4px;overflow:hidden;margin-top:1rem}
.goal-progress-fill{height:100%;background:var(--primary-color);transition:width 0.3s ease}
.goal-card{cursor:pointer;position:relative;overflow:hidden}
.goal-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-medium)}
@media(max-width:768px){.profile-container{padding:1rem}
.profile-section{padding:1rem}
.profile-info-grid{grid-template-columns:1fr}
.profile-actions{flex-direction:column}
.goal-input-group{flex-direction:column}}
/* ============================================
   SPA LAYOUT STYLES
   ============================================ */

/* Main App Container */
.app-container {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
    transition: margin-left 0.3s ease;
}

/* Desktop: Content area with sidebar */
@media (min-width: 769px) {
    .app-container {
        margin-left: 250px;
        padding-bottom: 3rem;
    }
}

/* Mobile: Content area with bottom nav */
@media (max-width: 768px) {
    .app-container {
        margin-left: 0;
        padding-bottom: 80px; /* Space for bottom nav */
    }
}

/* App Content Area (where views load) */
.app-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Router Loading Indicator */
#routerLoading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-secondary);
}

/* Error Container */
.error-container {
    text-align: center;
    padding: 3rem;
    max-width: 500px;
    margin: 0 auto;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-container h2 {
    color: var(--danger-color);
    margin-bottom: 1rem;
}

.error-container p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Bottom Navigation - SPA Version */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: none; /* Hidden by default, shown on mobile */
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    /* Fix for mobile keyboard issues */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex !important;
    }
}

.bottom-nav .nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    flex: 1;
}

.bottom-nav .nav-btn .icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.bottom-nav .nav-btn:hover,
.bottom-nav .nav-btn.active {
    color: var(--primary-color);
}

.bottom-nav .nav-btn.active {
    background: linear-gradient(to top, rgba(102, 126, 234, 0.1), transparent);
}

/* Sidebar Navigation - SPA Version */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: none; /* Hidden by default, shown on desktop */
    flex-direction: column;
    z-index: 90;
    overflow-y: auto;
}

@media (min-width: 769px) {
    .sidebar {
        display: flex !important;
    }
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    font-size: 1.5rem;
}

.sidebar-title {
    font-size: 1.1rem;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    width: 100%;
    text-align: left;
}

.sidebar-nav-item .icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.sidebar-nav-item.active {
    background: linear-gradient(to right, rgba(102, 126, 234, 0.15), transparent);
    color: var(--primary-color);
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
}

.sidebar-nav-item.logout-btn {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    color: var(--danger-color);
}

.sidebar-nav-item.logout-btn:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* Profile Section Styles for SPA */
.profile-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    margin-bottom: 1.5rem;
}

.profile-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-info-item label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.profile-value {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-primary);
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.progress-stat {
    text-align: center;
}

.progress-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.progress-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.5s ease;
    border-radius: 6px;
}

/* Admin Notifications - Users Table */
.users-table {
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
}

.users-table-header,
.users-table-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    padding: 1rem;
    align-items: center;
}

.users-table-header {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.users-table-row {
    border-bottom: 1px solid var(--border-color);
}

.users-table-row:last-child {
    border-bottom: none;
}

.users-table-row:hover {
    background: var(--bg-secondary);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .profile-info-grid {
        grid-template-columns: 1fr;
    }

    .progress-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .users-table-header,
    .users-table-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .users-table-header div:not(:first-child) {
        display: none;
    }
}

/* Version Footer */
.version-footer {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    z-index: 50;
}

@media (max-width: 768px) {
    .version-footer {
        bottom: 70px; /* Above bottom nav */
    }
}


/* Asset Cards for SPA Assets View */
.asset-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

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

.asset-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.asset-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
    border-radius: 12px;
    font-size: 1.5rem;
}

.asset-info h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.asset-code {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.asset-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.asset-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.asset-detail-row span:first-child {
    color: var(--text-secondary);
}

.asset-detail-row span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.asset-detail-row.positive span:last-child {
    color: var(--success-color);
}

.asset-detail-row.negative span:last-child {
    color: var(--danger-color);
}

@media (max-width: 768px) {
    .asset-card {
        padding: 1rem;
    }

    .asset-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .asset-info h3 {
        font-size: 1rem;
    }
}


/* Converter Rates Table Styles */
.rates-section {
    margin-top: 2rem;
}

.rates-header {
    margin-bottom: 1.5rem;
}

.rates-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.rates-category {
    margin-bottom: 2rem;
}

.rates-category h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.rate-card {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.rate-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.rate-symbol {
    font-size: 1.5rem;
    font-weight: 600;
}

.rate-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.rate-card-body {
    margin-bottom: 0.75rem;
}

.rate-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.rate-badge {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.15rem 0.5rem;
    background: var(--warning-color);
    color: white;
    font-size: 0.7rem;
    border-radius: 4px;
}

.rate-card-footer {
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .rates-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .rate-card {
        padding: 0.75rem;
    }

    .rate-value {
        font-size: 1.1rem;
    }
}

