/**
 * ScarlettAI Modular CSS Styles
 * Professional trading interface with dark theme
 */

:root {
    --bg-dark: #0a0a0a;
    --bg-panel: #141414;
    --bg-card: #1a1a1a;
    --border: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --success: #00ff88;
    --warning: #ffaa00;
    --danger: #ff3366;
    --info: #00aaff;
    --accent: #7c3aed;
    --border-radius: 8px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Layout */
.container {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: 100vh;
}

.sidebar {
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
}

.main-content {
    padding: 2rem;
    overflow-y: auto;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--info) 100%);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: bold;
}

/* User Info */
.user-info {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--success);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    margin-bottom: 1rem;
    color: var(--success);
    font-size: 0.9rem;
}

.user-name {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    color: var(--text-primary);
}

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

/* Status Cards */
.status-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.status-card h2, .status-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Metrics */
.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.metric:last-child {
    border-bottom: none;
}

.metric-value {
    font-weight: bold;
    color: var(--success);
}

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

/* Buttons */
.btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.btn-primary {
    background: var(--accent);
    width: 100%;
}

.btn-secondary {
    background: var(--bg-panel);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    box-shadow: 0 4px 12px rgba(42, 42, 42, 0.4);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.btn-full {
    width: 100%;
    margin-top: 1rem;
}

/* Log Container */
.log-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1rem;
    height: 300px;
    overflow-y: auto;
    font-size: 0.8rem;
    line-height: 1.4;
}

.log-entry {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.log-success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--success);
}

.log-warning {
    background: rgba(255, 170, 0, 0.1);
    color: var(--warning);
}

.log-error {
    background: rgba(255, 51, 102, 0.1);
    color: var(--danger);
}

.log-info {
    background: rgba(0, 170, 255, 0.1);
    color: var(--info);
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

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

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.password-info {
    color: var(--warning);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
}

.password-hint {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* Error Messages */
.error-message {
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    margin-top: 1rem;
    color: var(--danger);
    font-size: 0.9rem;
}

/* Utility Classes */
.hidden {
    display: none;
}

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

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

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow-x: auto;
        overflow-y: visible;
    }

    .main-content {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

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

    .login-form {
        width: 95vw;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        padding: 1rem;
    }
    
    .logo {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    
    .status-card {
        padding: 1rem;
    }
    
    .log-container {
        height: 200px;
    }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-panel);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

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

.status-card {
    animation: fadeIn 0.3s ease-out;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}