/* Dashboard-specific styles */

/* Login Screen */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--card-bg-solid);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.login-logo img {
    max-width: 200px;
    height: auto;
}

.login-card h1 {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent-violet) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 0.95rem;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--card-bg);
}

/* Show/hide password toggle for the dashboard login screen. Kept
   scoped to .input-group so it cannot accidentally affect any other
   input on the dashboard. Mirrors the .input-with-icon pattern used
   on the public marketing site (styles/site.css). */
.input-group .input-with-icon {
    position: relative;
    display: block;
}

.input-group .input-with-icon input {
    width: 100%;
    padding-right: 44px;
}

.input-group .input-icon-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.input-group .input-icon-btn:hover {
    color: var(--text-primary);
    background: var(--card-bg);
}

.login-error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: #f85149;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 0, 198, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

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

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.login-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Body */
.dashboard-body {
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dashboard-body main {
    display: grid !important;
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 100px);
}

.dashboard-body .content {
    overflow-y: auto;
    min-height: 0;
}

.dashboard-body footer {
    flex-shrink: 0;
    z-index: 10;
}

/* Navigation Footer */
.nav-footer {
    padding: 0 var(--sp-base);
    border-top: 1px solid var(--nav-border);
    padding-top: var(--sp-lg);
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: var(--sp-sm) var(--sp-base);
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.93rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(248, 81, 73, 0.1);
    border-color: #f85149;
    color: #f85149;
}

/* User Info */
.user-info {
    padding: 8px 16px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Tab Content */
.tab-content {
    display: none;
}

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

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin: 8px 0;
}

.stat-card {
    background: var(--card-bg);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(149, 0, 198, 0.15);
    border-color: var(--accent);
}

.stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2px 0;
}

.stat-value.positive {
    color: #3fb950;
}

.stat-value.negative {
    color: #f85149;
}

.stat-description {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Large text mode */
body.large-text .stat-card {
    padding: 16px;
}

body.large-text .stat-label {
    font-size: 0.8rem;
    margin-bottom: 4px;
}

body.large-text .stat-value {
    font-size: 1.6rem;
    margin: 4px 0;
}

body.large-text .stat-description {
    font-size: 0.75rem;
    margin-top: 4px;
}

body.large-text .stats-grid {
    gap: 14px;
    margin: 14px 0;
}

body.large-text .performance-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

body.large-text .section-card h2 {
    font-size: 1.3rem;
}

/* Text size toggle button */
#textSizeToggle {
    font-weight: 700;
    font-size: 14px;
}

body.large-text #textSizeIcon {
    font-size: 16px;
}

/* Toggle button tooltips */
.toggle-btn.has-tooltip {
    position: relative;
}

.toggle-btn.has-tooltip:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    right: 0;
    transform: translateY(8px);
    padding: 8px 12px;
    background: rgba(13, 17, 23, 0.95);
    color: #ffffff;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(149, 0, 198, 0.3);
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

.toggle-btn.has-tooltip:hover::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 10px;
    transform: translateY(0px);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(13, 17, 23, 0.95);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    padding: 20px;
}

.chart-container canvas {
    max-height: 100%;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

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

/* Monitor Grid */
.monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.monitor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.monitor-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.monitor-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

/* Cycle Info */
.cycle-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.cycle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.cycle-item span:first-child {
    color: var(--text-secondary);
    font-weight: 600;
}

.cycle-item span:last-child {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Table Styles */
.table-container {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    margin: 20px 0;
}

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

.data-table thead {
    background: var(--card-bg);
}

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

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.data-table tr:hover {
    background: var(--card-bg);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.loading-row {
    text-align: center;
    padding: 40px !important;
    color: var(--text-secondary);
}

/* Performance Section */
.performance-section {
    margin-bottom: 16px;
}

.performance-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Loading Message */
.loading-message {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.buy {
    background: rgba(63, 185, 80, 0.2);
    color: #3fb950;
}

.badge.sell {
    background: rgba(248, 81, 73, 0.2);
    color: #f85149;
}

.badge.active {
    background: rgba(88, 166, 255, 0.2);
    color: #58a6ff;
}

.badge.completed {
    background: rgba(149, 0, 198, 0.2);
    color: var(--accent);
}

/* Custom Tooltip Styles */
.stat-card[data-tooltip] {
    cursor: help;
}

.stat-card[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    padding: 12px 16px;
    background: rgba(13, 17, 23, 0.95);
    color: #ffffff;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: normal;
    max-width: 280px;
    width: max-content;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(149, 0, 198, 0.3);
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

.stat-card[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0px);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(13, 17, 23, 0.95);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(-8px);
    }
}

/* Action Buttons */
.action-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.action-btn:hover {
    background: rgba(248, 81, 73, 0.1);
    border-color: #f85149;
}

.edit-btn:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: #58a6ff;
}

.delete-btn:hover {
    background: rgba(248, 81, 73, 0.2);
}

/* Notification Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Badge additional styles */
.badge.closed {
    background: rgba(63, 185, 80, 0.2);
    color: #3fb950;
}

.badge.open {
    background: rgba(88, 166, 255, 0.2);
    color: #58a6ff;
}

.badge.maker {
    background: rgba(63, 185, 80, 0.2);
    color: #3fb950;
}

.badge.taker {
    background: rgba(248, 81, 73, 0.2);
    color: #f85149;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .login-card {
        padding: 32px 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .monitor-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
    }
}
