/* Mobile-first design for Trader System */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #10b981;
    --danger: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Login Card */
.login-card {
    background: var(--bg-secondary);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 40px 24px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo {
    color: var(--primary);
    margin: 0 auto 24px;
}

.logo svg {
    width: 60px;
    height: 60px;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

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

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

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

/* Button Styles */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    animation: rotate 1s linear infinite;
    width: 20px;
    height: 20px;
}

.spinner circle {
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* Error Message */
.error-message {
    background: #fee2e2;
    color: var(--danger);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: left;
    border: 1px solid #fecaca;
}

/* Footer */
.footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.footer p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Dashboard */
.dashboard {
    background: var(--bg-secondary);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    overflow: hidden;
}

.dashboard-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-small svg {
    width: 40px;
    height: 40px;
}

.header-info h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.username {
    font-size: 14px;
    opacity: 0.9;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dashboard-content {
    padding: 24px;
}

/* Status Card */
.status-card {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 24px;
}

.status-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.status-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.status-text {
    font-size: 14px;
    opacity: 0.9;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.info-card {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.info-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.status-active {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

/* API Info */
.api-info {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.api-info h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.endpoint-list {
    list-style: none;
}

.endpoint-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.endpoint-list li:last-child {
    border-bottom: none;
}

.method {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    min-width: 50px;
    text-align: center;
}

.method.get {
    background: #dbeafe;
    color: #1e40af;
}

.method.post {
    background: #dcfce7;
    color: #166534;
}

.path {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-primary);
    flex: 1;
}

.badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #e5e7eb;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.protected {
    background: #fef3c7;
    color: #92400e;
}

/* Responsive - Tablet and up */
@media (min-width: 768px) {
    .login-card {
        padding: 48px 40px;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Single column for very small screens */
@media (max-width: 360px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
