/* Modern Binance Bot Styles */
:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1a1a2e;
    --darker: #0f0f1e;
    --light: #f8f9fa;
    --gray: #6b7280;
    --profit: #10b981;
    --loss: #ef4444;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border-color: #4b5563;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    color: #fff;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    gap: 10px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover, .nav-link.active {
    background: rgba(102, 126, 234, 0.2);
    color: #fff;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.stat-content h3 {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin: 5px 0;
}

.stat-card.profit .stat-value {
    color: var(--profit);
}

.stat-card.loss .stat-value {
    color: var(--loss);
}

/* Status Bar */
.status-bar {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: var(--success);
    color: white;
}

.status-badge.inactive {
    background: var(--danger);
    color: white;
}

/* Positions Grid */
.positions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.position-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.position-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.position-card.long {
    border-left: 4px solid var(--success);
}

.position-card.short {
    border-left: 4px solid var(--danger);
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
}

.position-symbol h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.position-side {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.position-side.long {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.position-side.short {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.position-pnl {
    font-size: 18px;
    font-weight: 700;
}

.position-pnl.profit {
    color: var(--profit);
}

.position-pnl.loss {
    color: var(--loss);
}

.position-details {
    margin: 20px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.leverage-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
}

.profit-text {
    color: var(--profit);
}

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

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

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

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-large {
    padding: 15px 40px;
    font-size: 16px;
}

/* Settings Page */
.settings-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 15px;
}

.settings-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.settings-section:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.settings-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 15px 30px;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: white;
    background: rgba(102, 126, 234, 0.1);
}

.tab-btn.active {
    color: white;
    border-bottom-color: var(--primary);
    background: rgba(102, 126, 234, 0.15);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.coins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.coin-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.coin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.coin-card:hover {
    transform: translateY(-4px);
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.2);
}

.coin-card:hover::before {
    transform: scaleX(1);
}

.coin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.coin-header h4 {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 600;
}

.coin-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.coin-settings .setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.coin-settings .setting-row label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.coin-settings input[type="number"] {
    width: 100px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    text-align: right;
    transition: all 0.3s;
}

.coin-settings input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.coin-settings input[type="number"]:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

/* Modern Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4b5563;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 32px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

input:checked + .slider:before {
    transform: translateX(28px);
}

.slider:hover {
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}

/* Toggle Checkbox Alternative Style */
.form-check-input[type="checkbox"] {
    width: 3rem;
    height: 1.5rem;
    background-color: #4b5563;
    border: none;
    border-radius: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.form-check-input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.form-check-input[type="checkbox"]:focus {
    border: none;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.toggle-label {
    color: var(--text-primary);
    font-weight: 500;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 14px;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Active Coins Section */
.coins-section {
    margin: 30px 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title.collapsible {
    cursor: pointer;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    transition: all 0.3s;
    user-select: none;
}

.section-title.collapsible:hover {
    background: rgba(255, 255, 255, 0.08);
}

.chevron {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.active-coins {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.active-coin-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    position: relative;
}

.active-coin-card:hover {
    transform: translateY(-4px);
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.coin-info {
    text-align: center;
}

.coin-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: white;
}

.coin-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.badge-active {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active.usdc {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.positions-section {
    margin-top: 40px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Flash Messages */
.flash-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.close-btn {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    margin-left: auto;
}

/* Table */
.history-table {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
}

.history-table thead {
    background: rgba(255, 255, 255, 0.1);
}

.history-table th, .history-table td {
    padding: 15px;
    text-align: left;
}

.history-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.3s;
}

.user-dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s;
}

.dropdown-arrow.rotated {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--primary);
}

.dropdown-header i {
    font-size: 20px;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

.dropdown-item.logout:hover {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
}

/* Change Password Page */
.change-password-container {
    max-width: 600px;
    margin: 0 auto;
}

.password-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.password-card .card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.password-card .card-header i {
    font-size: 28px;
    color: var(--primary);
}

.password-card .card-header h2 {
    margin: 0;
    font-size: 24px;
}

.password-form .form-group {
    margin-bottom: 25px;
}

.password-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text);
}

.password-input-wrapper {
    position: relative;
    display: flex;
}

.password-input-wrapper .form-control {
    flex: 1;
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

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

.password-strength {
    margin-top: 10px;
}

.strength-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    background: var(--danger);
    transition: all 0.3s;
    border-radius: 10px;
}

.strength-text {
    font-size: 12px;
    color: var(--gray);
    font-weight: 600;
}

.form-hint {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
}

.form-hint.match {
    color: var(--success);
}

.form-hint.no-match {
    color: var(--danger);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.form-actions .btn {
    flex: 1;
}

.security-tips {
    margin-top: 30px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    border-left: 4px solid var(--primary);
}

.security-tips h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 16px;
    color: var(--primary);
}

.security-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.security-tips li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--text);
    font-size: 14px;
}

.security-tips li i {
    color: var(--success);
    font-size: 12px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .positions-grid {
        grid-template-columns: 1fr;
    }
    
    .coins-grid {
        grid-template-columns: 1fr;
    }
}

