/**
 * ZYN Trade System - Dashboard Stylesheet
 * Version: 2.1
 */

/* ===== Dashboard Layout ===== */
.dashboard-page {
    background: var(--bg-darker);
}

.dashboard-page .main-content {
    padding-top: calc(var(--navbar-height) + 2rem);
    padding-bottom: 2rem;
}

/* ===== Dashboard Header ===== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-title {
    font-size: 1.75rem;
    margin: 0;
}

.dashboard-subtitle {
    color: var(--text-muted);
    margin: 0;
}

/* ===== Account Summary Cards ===== */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all var(--transition-normal);
}

.summary-card:hover {
    border-color: var(--border-glow);
}

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

.summary-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.25rem;
}

.summary-card-icon.balance {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.summary-card-icon.package {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary);
}

.summary-card-icon.expiry {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-yellow);
}

.summary-card-icon.trades {
    background: rgba(124, 58, 237, 0.1);
    color: var(--secondary);
}

.summary-card-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.summary-card-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.summary-card-change {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.summary-card-change.positive {
    color: var(--accent-green);
}

.summary-card-change.negative {
    color: var(--accent-red);
}

/* ===== Robot Control Panel ===== */
.robot-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

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

.robot-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.robot-status-indicator {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.robot-status-indicator.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.robot-status-indicator.standby {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-yellow);
}

.robot-status-indicator.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.robot-status-text h4 {
    margin: 0;
    font-size: 1.25rem;
}

.robot-status-text p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Master Toggle */
.master-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.master-toggle-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    width: 70px;
    height: 36px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-darker);
    border: 2px solid var(--border-color);
    border-radius: 36px;
    transition: all var(--transition-normal);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-normal);
}

.toggle-switch input:checked + .toggle-slider {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent-green);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(34px);
    background: var(--accent-green);
    box-shadow: 0 0 15px var(--accent-green);
}

/* Robot Settings Grid */
.robot-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.setting-group {
    background: var(--bg-darker);
    border-radius: 12px;
    padding: 1.25rem;
}

.setting-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.setting-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* Strategy Selection */
.strategy-selector {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.strategy-selector-title {
    font-size: 1rem;
    margin-bottom: 1rem;
}

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

.strategy-option {
    position: relative;
}

.strategy-option input {
    position: absolute;
    opacity: 0;
}

.strategy-option label {
    display: block;
    background: var(--bg-darker);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.strategy-option label:hover {
    border-color: var(--primary);
}

.strategy-option input:checked + label {
    border-color: var(--primary);
    background: rgba(0, 212, 255, 0.1);
}

.strategy-option label .name {
    font-family: var(--font-display);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

.strategy-option label .winrate {
    font-size: 0.8rem;
    color: var(--accent-green);
}

/* ===== Statistics Section ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    border-radius: 10px;
    font-size: 1.25rem;
}

.stat-card-value {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== Trade History ===== */
.trade-history {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

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

.trade-history-title {
    font-size: 1.25rem;
    margin: 0;
}

.trade-history-filters {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

.trade-list {
    max-height: 400px;
    overflow-y: auto;
}

.trade-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.trade-item:hover {
    background: var(--bg-card-hover);
}

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

.trade-strategy {
    font-weight: 600;
}

.trade-asset {
    color: var(--text-secondary);
}

.trade-amount {
    font-family: var(--font-display);
}

.trade-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trade-result.win {
    color: var(--accent-green);
}

.trade-result.loss {
    color: var(--accent-red);
}

.trade-pnl {
    font-family: var(--font-display);
    font-weight: 600;
}

.trade-pnl.positive {
    color: var(--accent-green);
}

.trade-pnl.negative {
    color: var(--accent-red);
}

/* ===== Signal Status ===== */
.signal-status {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.signal-status-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.signal-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.signal-indicator.active {
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse 1.5s ease-in-out infinite;
}

.signal-indicator.standby {
    background: var(--accent-yellow);
}

.signal-indicator.inactive {
    background: var(--accent-red);
}

.signal-text {
    font-weight: 600;
}

.signal-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== Quick Actions ===== */
.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    color: var(--primary);
}

.quick-action-btn i {
    font-size: 1.25rem;
    color: var(--primary);
}

/* ===== Leaderboard ===== */
.leaderboard {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.leaderboard-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-title {
    font-size: 1.25rem;
    margin: 0;
}

.leaderboard-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.leaderboard-rank {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darker);
    border-radius: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    margin-right: 1rem;
}

.leaderboard-rank.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    color: var(--bg-dark);
}

.leaderboard-rank.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    color: var(--bg-dark);
}

.leaderboard-rank.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #b5651d 100%);
    color: var(--bg-dark);
}

.leaderboard-user {
    flex: 1;
}

.leaderboard-user-name {
    font-weight: 600;
}

.leaderboard-user-country {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.leaderboard-stats {
    text-align: right;
}

.leaderboard-profit {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--accent-green);
}

.leaderboard-winrate {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ===== Profile Section ===== */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--bg-dark);
}

.profile-info h3 {
    margin: 0 0 0.25rem;
}

.profile-info p {
    color: var(--text-muted);
    margin: 0;
}

.profile-badge {
    display: inline-block;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* ===== Settings Page ===== */
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.settings-section-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

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

.settings-label {
    font-weight: 500;
}

.settings-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

.admin-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.admin-stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
}

.admin-stat-label {
    color: var(--text-muted);
}

/* User Verification Table */
.verification-table {
    width: 100%;
}

.verification-table th {
    text-align: left;
    padding: 1rem;
    background: var(--bg-darker);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
}

.verification-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.btn-approve {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-approve:hover {
    background: var(--accent-green);
    color: var(--bg-dark);
}

.btn-reject {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-reject:hover {
    background: var(--accent-red);
    color: white;
}

/* ===== Notifications ===== */
.notification-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.notification-item:hover {
    background: var(--bg-card-hover);
}

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

.notification-item.unread {
    background: rgba(0, 212, 255, 0.05);
}

.notification-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1rem;
}

.notification-icon.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.notification-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-yellow);
}

.notification-icon.info {
    background: rgba(0, 212, 255, 0.2);
    color: var(--primary);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.notification-time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== Calendar View ===== */
.trading-calendar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-darker);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.calendar-day:hover {
    background: var(--bg-card-hover);
}

.calendar-day.profit {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--accent-green);
}

.calendar-day.loss {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--accent-red);
}

.calendar-day.no-trade {
    color: var(--text-muted);
}

.calendar-day-number {
    font-weight: 600;
}

.calendar-day-pnl {
    font-size: 0.65rem;
    margin-top: 0.25rem;
}

/* ===== Responsive Dashboard ===== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .robot-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .trade-item {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }

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

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

    .robot-settings {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        flex-direction: column;
    }

    .quick-action-btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .trade-item {
        grid-template-columns: 1fr;
        text-align: center;
    }

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