:root {
    --bg-dark: #160e28;
    --bg-card: rgba(22, 14, 38, 0.98);
    --text-main: #ffffff;
    --text-muted: #b4a2e5;
    --accent: #00f0ff;
    --accent-hover: #ff00ff;
    --border: rgba(255, 0, 255, 0.5);
    --glass-blur: blur(24px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='120' height='60' viewBox='0 0 120 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30 Q 30 0, 60 30 T 120 30' fill='none' stroke='rgba(0, 240, 255, 0.1)' stroke-width='2'/%3E%3Cpath d='M0 30 Q 30 60, 60 30 T 120 30' fill='none' stroke='rgba(255, 0, 255, 0.1)' stroke-width='2'/%3E%3C/svg%3E"),
        linear-gradient(rgba(255, 0, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.08) 1px, transparent 1px),
        radial-gradient(circle at top right, rgba(0, 240, 255, 0.2), transparent 60%),
        radial-gradient(circle at bottom left, rgba(255, 0, 255, 0.2), transparent 60%);
    background-size: 120px 60px, 40px 40px, 40px 40px, 100% 100%, 100% 100%;
    background-attachment: fixed;
    animation: waveDrift 20s linear infinite;
}

@keyframes waveDrift {
    0% { background-position: 0px 0px, 0px 0px, 0px 0px, 0 0, 0 0; }
    100% { background-position: 120px 60px, 40px 40px, 40px 40px, 0 0, 0 0; }
}

.container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.dashboard-container {
    width: 100%;
    max-width: 1000px;
    padding: 2rem;
    align-self: flex-start;
    margin-top: 2rem;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 0, 255, 0.4), inset 0 0 15px rgba(0, 240, 255, 0.4);
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #00f0ff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 25px rgba(255, 0, 255, 0.8), 0 0 10px rgba(0, 240, 255, 0.5);
    letter-spacing: 1px;
}

p.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

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

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.7), rgba(255, 0, 255, 0.7));
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(255, 0, 255, 0.6), inset 0 0 10px rgba(0, 240, 255, 0.4);
}

.btn:hover {
    background: linear-gradient(135deg, #00f0ff, #ff00ff);
    box-shadow: 0 6px 30px rgba(0, 240, 255, 0.8), inset 0 0 15px rgba(255, 0, 255, 0.6);
    transform: translateY(-1px);
}

.btn:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    margin-top: 1rem;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: var(--text-main);
    border-bottom: 2px solid var(--accent);
}

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

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

.widget {
    background: rgba(22, 14, 38, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 25px rgba(255, 0, 255, 0.2), inset 0 0 15px rgba(0, 240, 255, 0.2);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-linked {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.status-unlinked {
    background: rgba(244, 63, 94, 0.2);
    color: #fb7185;
}

#data-result {
    margin-top: 1rem;
    padding: 1rem;
    background: #0f172a;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

/* Phase 2 Additions */
.dashboard-layout {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.sidebar {
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stock-item {
    background: rgba(22, 14, 38, 0.95);
    border: 1px solid rgba(255, 0, 255, 0.3);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stock-item:hover, .stock-item.active {
    background: rgba(30, 20, 50, 1);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4), inset 0 0 10px rgba(255, 0, 255, 0.3);
}

.stock-symbol {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
}

.stock-price {
    font-family: monospace;
    font-size: 1rem;
}

.price-up {
    color: #34d399;
}

.price-down {
    color: #fb7185;
}

.chart-container {
    background: rgba(22, 14, 38, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    height: 450px;
    position: relative;
    box-shadow: 0 4px 25px rgba(255, 0, 255, 0.2), inset 0 0 15px rgba(0, 240, 255, 0.2);
}

.order-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    appearance: none;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}
