/* ==========================================================================
   Strategy Service - Consolidated Styles
   ========================================================================== */

/* Base Styles */
body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 
                'Segoe UI', Roboto, Helvetica Neue, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #131722;
    color: #d1d4dc;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================================================
   Cognito-style Login Page Styles
   ========================================================================== */

/* Cognito login page specific body styles */
body.cognito-login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #2c3e50;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
}

body.cognito-login-page .container {
    background-color: #34495e;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.signin-card {
    text-align: left;
}

.signin-card h1 {
    color: #ffffff;
    margin: 0 0 0.5rem 0;
    font-size: 1.8em;
    font-weight: 600;
    text-align: center;
}

.signin-subtitle {
    color: #bdc3c7;
    margin: 0 0 2rem 0;
    font-size: 0.95em;
    text-align: center;
    font-weight: 400;
}

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

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

.signin-form label {
    display: block;
    color: #ffffff;
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.signin-form input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #3498db;
    border-radius: 4px;
    background-color: #ecf0f1;
    color: #2c3e50;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.signin-form input[type="text"]:focus {
    outline: none;
    border-color: #2980b9;
    background-color: #ffffff;
}

.next-button {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background-color: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 1rem;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
}

.next-button:hover {
    background-color: #2980b9;
    color: #ffffff;
    text-decoration: none;
}

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

.signin-footer p {
    color: #bdc3c7;
    font-size: 0.9em;
    margin: 0;
}

.create-account-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.create-account-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* ==========================================================================
   Landing Page Styles
   ========================================================================== */

/* Landing page specific body styles */
body.landing-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #1a1a1a;
    color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.landing-page .container {
    background-color: #2d2d2d;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px;
}

body.landing-page h1 {
    color: #00ff9d;
    margin-bottom: 1rem;
    text-align: center;
}

body.landing-page p {
    color: #cccccc;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

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

body.landing-page input[type="text"] {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #404040;
    border-radius: 4px;
    background-color: #333333;
    color: #ffffff;
    font-size: 1rem;
    box-sizing: border-box;
}

body.landing-page input[type="text"]:focus {
    outline: none;
    border-color: #00ff9d;
}

body.landing-page button {
    width: 100%;
    padding: 0.8rem;
    background-color: #00ff9d;
    color: #1a1a1a;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

body.landing-page button:hover {
    background-color: #00cc7d;
}

body.landing-page .error {
    color: #ff4444;
    margin-top: 1rem;
    text-align: center;
    display: none;
}

/* ==========================================================================
   Forbidden/Error Page Styles
   ========================================================================== */

body.forbidden-page .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

body.forbidden-page .error-card {
    background-color: #1e222d;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border: 1px solid #363a45;
    text-align: center;
}

body.forbidden-page h1 {
    color: #f23645;
    margin: 0 0 20px 0;
    font-size: 2em;
}

.error-icon {
    font-size: 4em;
    color: #f23645;
    margin-bottom: 20px;
}

.error-message {
    color: #787b86;
    margin-bottom: 30px;
}

.error-details {
    background-color: #2a2e39;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    color: #d1d4dc;
    font-family: monospace;
    text-align: left;
}

.action-buttons {
    margin-top: 30px;
}

.button {
    background-color: #2962FF;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s;
    margin: 0 10px;
}

.button:hover {
    background-color: #1e53e5;
}

.button.secondary {
    background-color: #2a2e39;
}

.button.secondary:hover {
    background-color: #363a45;
}

/* ==========================================================================
   Dashboard Styles
   ========================================================================== */

.dashboard-page .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #363a45;
}

.header h1 {
    color: #d1d4dc;
    margin: 0;
    font-size: 2.5em;
}

.reload-button {
    background-color: #2962FF;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reload-button:hover {
    background-color: #1e53e5;
    transform: translateY(-2px);
}

.reload-icon {
    font-size: 1.2em;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.strategies-column, .orders-column {
    background-color: #1e222d;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #363a45;
}

.strategies-column h2, .orders-column h2 {
    color: #d1d4dc;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #363a45;
    padding-bottom: 10px;
}

.last-update {
    text-align: center;
    color: #787b86;
    font-size: 0.9em;
    margin-top: 20px;
}

/* Connection Status */
.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #1e222d;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    border: 1px solid #363a45;
    font-size: 0.9em;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #f23645;
    animation: pulse 2s infinite;
}

.connection-status.connected .status-indicator {
    background-color: #00ff9d;
}

.connection-status.disconnected .status-indicator {
    background-color: #f23645;
}

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

/* Connections Panel */
.connections-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #1e222d;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    width: 300px;
    z-index: 1000;
    transition: all 0.3s ease;
    border: 1px solid #363a45;
}

.connections-header {
    padding: 15px;
    background-color: #2a2e39;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #363a45;
}

.connections-count {
    display: flex;
    align-items: center;
    gap: 10px;
}

.count-number {
    font-size: 1.2em;
    font-weight: bold;
    color: #d1d4dc;
}

.count-label {
    color: #787b86;
}

.toggle-arrow {
    color: #787b86;
    transition: transform 0.3s ease;
}

.connections-panel.collapsed .toggle-arrow {
    transform: rotate(-90deg);
}

.connections-content {
    max-height: 400px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
    background-color: #1e222d;
}

.connections-panel.collapsed .connections-content {
    max-height: 0;
    overflow: hidden;
}

.connection-card {
    padding: 15px;
    border-bottom: 1px solid #363a45;
    background-color: #1e222d;
}

.connection-card:last-child {
    border-bottom: none;
}

.connection-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.connection-user {
    font-weight: bold;
    color: #d1d4dc;
    font-size: 1em;
}

.connection-key {
    font-family: 'Consolas', monospace;
    background-color: #2a2e39;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #d1d4dc;
    border: 1px solid #363a45;
}

.connection-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.connection-ip {
    color: #00ff9d;
    font-family: 'Consolas', monospace;
    font-size: 0.85em;
}

.connection-time {
    color: #787b86;
    font-size: 0.85em;
    white-space: nowrap;
}

/* Strategy Cards */
.strategy-card {
    background: linear-gradient(135deg, #2a2e39 0%, #252935 100%);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 24px;
    border: 1px solid #363a45;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.strategy-card:hover {
    background: linear-gradient(135deg, #2d3142 0%, #282a38 100%);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border-color: #4a5068;
}

.strategy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.strategy-name {
    color: #ffffff;
    font-size: 1.4em;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.strategy-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.filter-name {
    color: #9ca3af;
    font-size: 0.8em;
    font-style: italic;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-active {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.25) 0%, rgba(0, 200, 120, 0.25) 100%);
    color: #00ff9d;
    box-shadow: 0 0 12px rgba(0, 255, 157, 0.3);
}

.status-inactive {
    background: linear-gradient(135deg, rgba(120, 123, 134, 0.25) 0%, rgba(100, 103, 114, 0.25) 100%);
    color: #9ca3af;
}

.status-notset {
    background: linear-gradient(135deg, rgba(120, 123, 134, 0.25) 0%, rgba(100, 103, 114, 0.25) 100%);
    color: #9ca3af;
}

.status-blocked {
    background: linear-gradient(135deg, rgba(242, 54, 69, 0.25) 0%, rgba(220, 20, 60, 0.25) 100%);
    color: #ff6b7a;
    box-shadow: 0 0 12px rgba(242, 54, 69, 0.3);
}

.status-pending {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25) 0%, rgba(255, 170, 0, 0.25) 100%);
    color: #ffcc33;
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.3);
}

.status-position-long, .status-position-short {
    background: linear-gradient(135deg, rgba(41, 98, 255, 0.25) 0%, rgba(30, 83, 229, 0.25) 100%);
    color: #5b9cff;
    box-shadow: 0 0 12px rgba(41, 98, 255, 0.3);
}

/* Strategy Card Content */
.strategy-card .card-content {
    padding: 20px 24px 24px 24px;
}

.strategy-card .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

.strategy-card .info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.strategy-card .info-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 6px;
}

.strategy-card .info-label {
    color: #9ca3af;
    font-size: 0.9em;
    font-weight: 500;
    text-transform: capitalize;
    letter-spacing: 0.3px;
}

.strategy-card .info-value {
    color: #ffffff;
    font-size: 1em;
    font-weight: 600;
    font-family: 'Consolas', 'Monaco', monospace;
    text-align: right;
}

.strategy-card .card-footer {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.strategy-card .card-footer .date {
    color: #6b7280;
    font-size: 0.85em;
    text-align: center;
    font-style: italic;
}

/* Strategy Info Section */
.strategy-card .strategy-info {
    margin: 8px 0;
}

/* Custom Info Section */
.strategy-card .custom-info {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

/* Messages Section */
.strategy-card .messages {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    border-left: 3px solid #2962FF;
}

.strategy-card .messages .info-label {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 12px;
    color: #9ca3af;
}

.strategy-card .message {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    color: #d1d4dc;
    font-size: 0.9em;
    line-height: 1.4;
}

.strategy-card .message:last-child {
    margin-bottom: 0;
}

.strategy-card .message .timestamp {
    color: #787b86;
    font-size: 0.8em;
    margin-top: 6px;
    font-style: italic;
}

/* Add subtle pulse animation for active strategies */
.strategy-card .status-active {
    animation: subtlePulse 3s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% { 
        box-shadow: 0 0 12px rgba(0, 255, 157, 0.3);
    }
    50% { 
        box-shadow: 0 0 16px rgba(0, 255, 157, 0.5);
    }
}

/* Responsive improvements for strategy cards */
@media (max-width: 768px) {
    .strategy-card {
        margin-bottom: 16px;
    }
    
    .strategy-header {
        padding: 16px 20px 12px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-right {
        align-items: flex-start;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .strategy-name {
        font-size: 1.2em;
    }
    
    .strategy-card .card-content {
        padding: 16px 20px 20px 20px;
    }
    
    .strategy-card .info-item {
        padding: 10px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .strategy-card .info-value {
        text-align: left;
        font-size: 0.95em;
    }
    
    .strategy-card .update-data {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Shared Update Panel */
.shared-update-panel {
    margin-bottom: 1rem;
}

.shared-update-bubble {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.shared-update-bubble.oos-update {
    background: linear-gradient(145deg, #2a2215, #1a1510);
    border: 1px solid #666633;
    box-shadow: 0 2px 4px rgba(255, 165, 0, 0.2);
}

.shared-update-bubble .update-header {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85em;
}

.shared-update-bubble .update-type {
    background: #007acc;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8em;
}

.shared-update-bubble.oos-update .update-type {
    background: #cc7a00;
}

.shared-update-bubble .update-ticker {
    font-weight: bold;
    color: #ccc;
}

.shared-update-bubble .update-freq {
    color: #888;
    font-style: italic;
}

.shared-update-bubble .update-data {
    display: flex;
    gap: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.shared-update-bubble .update-time {
    color: #88cc88;
}

.shared-update-bubble .update-price {
    color: #cccc88;
    font-weight: bold;
}

.shared-update-bubble .update-volume {
    color: #cc88cc;
}

.oos-notice {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    margin-top: 8px;
    font-size: 0.8em;
    color: #ffaa00;
    text-align: center;
}

/* Generic Card (fallback) */
.card {
    background-color: #1e222d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #363a45;
}

.card .card-content {
    color: #787b86;
    text-align: center;
}

/* Order Cards */
.order-card {
    border-left: 4px solid #26a69a;
    background-color: #1e222d;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.order-card .card-header {
    background-color: #2a2e39;
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-card .card-title {
    color: #d1d4dc;
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
}

.order-card .card-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.order-card .card-content {
    padding: 15px;
}

.order-card .info-item {
    margin-bottom: 10px;
}

.order-card .info-label {
    color: #787b86;
    font-size: 0.9em;
    margin-bottom: 4px;
}

.order-card .info-value {
    color: #d1d4dc;
    font-size: 1.1em;
}

.trade-id {
    font-size: 0.9em;
    text-align: right;
    white-space: nowrap;
}

.position-bubble {
    background-color: rgba(41, 98, 255, 0.15);
    color: #2962FF;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.95em;
    letter-spacing: 1px;
    display: inline-block;
    margin-right: 6px;
}

.update-time-order {
    color: #787b86;
    font-size: 0.75em;
    text-align: right;
    margin-left: 10px;
    white-space: nowrap;
}

/* Price styling */
.price-up {
    color: #26a69a !important;
    font-weight: bold;
}

.price-down {
    color: #ef5350 !important;
    font-weight: bold;
}

.oos-value {
    color: #787b86;
    font-size: 0.8em;
    margin-top: 1px;
    font-style: italic;
}

/* Card State Sections */
.card-state-section {
    border-top: 1px solid #363a45;
    margin-top: 18px;
    padding-top: 10px;
    font-size: 0.95em;
}

.state-label {
    font-size: 0.8em;
    color: #787b86;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.state-value {
    font-weight: bold;
    color: #d1d4dc;
    margin-bottom: 6px;
}

.state-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
    margin-bottom: 2px;
}

.oos-row {
    font-size: 0.8em;
    color: #787b86;
    font-style: italic;
}

.state-date {
    min-width: 140px;
    text-align: left;
}

.state-price {
    color: #d1d4dc;
    font-family: 'Consolas', 'Monaco', monospace;
}

.state-profit {
    font-weight: bold;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1200px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    
    .connections-panel {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .connections-panel {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
    }
    
    .connection-status {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 20px;
        align-self: center;
    }
    
    body.landing-page .container {
        width: 95%;
        padding: 1.5rem;
    }
    
    body.landing-page h1 {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .strategies-column, .orders-column {
        padding: 15px;
    }
    
    .strategy-card, .order-card {
        padding: 15px;
    }
    
    .strategy-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
} 