/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-bg: #0a0e1a;
    --secondary-bg: #111827;
    --card-bg: #1a2234;
    --accent-blue: #00d4ff;
    --accent-blue-dark: #0066ff;
    --accent-green: #00ff88;
    --accent-red: #ff3366;
    --text-primary: #ffffff;
    --text-secondary: #8b9dc3;
    --border-color: rgba(0, 212, 255, 0.2);
    
    /* Fonts */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    
    /* Shadows */
    --glow-blue: 0 0 20px rgba(0, 212, 255, 0.4);
    --glow-green: 0 0 20px rgba(0, 255, 136, 0.4);
    --glow-red: 0 0 20px rgba(255, 51, 102, 0.4);
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== LOGIN PAGE ===== */
.login-body {
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-body::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 212, 255, 0.03) 2px, rgba(0, 212, 255, 0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0, 212, 255, 0.03) 2px, rgba(0, 212, 255, 0.03) 4px);
    pointer-events: none;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.1); }
}

.login-box {
    background: rgba(26, 34, 52, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--glow-blue);
    position: relative;
    animation: slideUp 0.6s ease-out;
}

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

.login-box.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    display: inline-block;
    margin-bottom: 20px;
    animation: rotate3d 8s linear infinite;
}

@keyframes rotate3d {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

.login-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-blue-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 1px;
}

.login-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 30px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-blue);
    margin-bottom: 12px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    font-size: 16px;
    color: var(--text-primary);
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-blue-dark));
    transition: width 0.3s ease;
}

.form-group input:focus ~ .input-line {
    width: 100%;
}

.error-message {
    display: none;
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: 8px;
    padding: 12px;
    color: var(--accent-red);
    font-size: 14px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

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

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
    border: none;
    border-radius: 12px;
    padding: 18px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-primary);
    font-family: var(--font-display);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
}

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

.login-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.login-btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-text, .btn-arrow {
    position: relative;
    z-index: 1;
}

.btn-arrow {
    margin-left: 10px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.login-btn:hover .btn-arrow {
    transform: translateX(5px);
}

.login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===== DASHBOARD ===== */
.dashboard-body {
    background: var(--primary-bg);
    min-height: 100vh;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 50px, rgba(0, 212, 255, 0.02) 50px, rgba(0, 212, 255, 0.02) 51px),
        repeating-linear-gradient(90deg, transparent, transparent 50px, rgba(0, 212, 255, 0.02) 50px, rgba(0, 212, 255, 0.02) 51px);
}

/* Header */
.dashboard-header {
    background: rgba(26, 34, 52, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-small {
    animation: rotate3d 8s linear infinite;
}

.dashboard-header h1 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-blue-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.balance-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-amount {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-green);
}

.leverage-label {
    font-size: 12px;
    color: var(--text-secondary);
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.logout-btn {
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.logout-btn:hover {
    background: var(--accent-red);
    color: white;
    box-shadow: var(--glow-red);
}

/* Main Dashboard */
.dashboard-main {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Instrument Section */
.instrument-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 30px;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.instrument-section label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-blue);
    margin-bottom: 10px;
    display: block;
}

.instrument-select {
    width: 100%;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.3s ease;
}

.instrument-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.current-price-display {
    text-align: center;
}

.price-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.current-price {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    color: var(--accent-blue);
    letter-spacing: 2px;
}

.current-time {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.refresh-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--accent-green);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-green);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Signal Card */
.signal-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.5s ease;
}

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

.signal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.signal-type {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 40px;
    border-radius: 15px;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 3px;
}

.signal-type.buy {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.05));
    border: 2px solid var(--accent-green);
    color: var(--accent-green);
    box-shadow: var(--glow-green);
}

.signal-type.sell {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.2), rgba(255, 51, 102, 0.05));
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
    box-shadow: var(--glow-red);
}

.signal-type.hold {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 193, 7, 0.05));
    border: 2px solid rgba(255, 193, 7, 0.8);
    color: rgba(255, 193, 7, 1);
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
}

.signal-icon {
    font-size: 40px;
}

.signal-probability {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 900;
    color: var(--accent-blue);
    text-shadow: var(--glow-blue);
}

.signal-body {
    background: rgba(0, 212, 255, 0.03);
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
}

.recommendation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.rec-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.rec-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.rec-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.rec-value {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.rec-value.profit {
    color: var(--accent-green);
}

.rec-value.loss {
    color: var(--accent-red);
}

.pips {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Analysis Container */
.analysis-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
}

.analysis-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.analysis-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.analysis-title .icon {
    font-size: 24px;
}

.analysis-content {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.8;
}

.analysis-content ul {
    list-style: none;
    padding-left: 0;
}

.analysis-content li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.analysis-content li:last-child {
    border-bottom: none;
}

.analysis-content li::before {
    content: '▸';
    color: var(--accent-blue);
    font-weight: bold;
    flex-shrink: 0;
}

/* AI Reasoning */
.ai-reasoning-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(0, 102, 255, 0.05));
    border: 1px solid var(--accent-blue);
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.2);
}

.reasoning-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 20px;
}

.reasoning-title .icon {
    font-size: 28px;
}

.reasoning-content {
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.9;
}

/* History Section */
.history-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.history-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 25px;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.history-instrument {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.history-signal {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.history-signal.buy {
    color: var(--accent-green);
}

.history-signal.sell {
    color: var(--accent-red);
}

.history-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 212, 255, 0.1);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1024px) {
    .analysis-container {
        grid-template-columns: 1fr;
    }
    
    .instrument-section {
        grid-template-columns: 1fr;
    }
    
    .recommendation-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .dashboard-main {
        padding: 20px;
    }
    
    .signal-type {
        font-size: 24px;
        padding: 15px 25px;
    }
    
    .signal-probability {
        font-size: 36px;
    }
    
    .history-grid {
        grid-template-columns: 1fr;
    }
}
