/* Login Page Styles - ApexAutomation Trading Bot */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Background Animation */
.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.trading-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(90deg, rgba(0, 255, 136, 0.1) 1px, transparent 1px),
        linear-gradient(rgba(0, 255, 136, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

.floating-numbers {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-numbers span {
    position: absolute;
    color: rgba(0, 255, 136, 0.3);
    font-size: 2rem;
    animation: float 15s infinite linear;
}

.floating-numbers span:nth-child(1) { left: 10%; animation-delay: 0s; }
.floating-numbers span:nth-child(2) { left: 20%; animation-delay: 3s; }
.floating-numbers span:nth-child(3) { left: 70%; animation-delay: 6s; }
.floating-numbers span:nth-child(4) { left: 80%; animation-delay: 9s; }
.floating-numbers span:nth-child(5) { left: 50%; animation-delay: 12s; }

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header */
.login-header {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.logo p {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Form */
.login-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.form-group input:invalid {
    border-color: #ff4444;
}

.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.password-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.toggle-icon {
    font-size: 1.2rem;
}

/* Field Errors */
.field-error {
    color: #ff4444;
    font-size: 0.8rem;
    margin-top: 5px;
    min-height: 1rem;
}

/* Form Options */
.form-options {
    margin-bottom: 25px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input:checked + .checkmark {
    background-color: #00ff88;
    border-color: #00ff88;
}

.checkbox-container input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Login Button */
.login-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 255, 136, 0.3);
}

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

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-text {
    transition: opacity 0.3s ease;
}

.loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.login-button.loading .button-text {
    opacity: 0;
}

.login-button.loading .loading-spinner {
    display: block;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Form Messages */
.form-error, .form-success {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.form-error {
    background-color: #ffe6e6;
    color: #cc0000;
    border: 1px solid #ffcccc;
}

.form-success {
    background-color: #e6ffe6;
    color: #006600;
    border: 1px solid #ccffcc;
}

/* Footer */
.login-footer {
    padding: 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.system-status {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.status-indicator {
    font-size: 1.2rem;
    margin-right: 8px;
}

.status-indicator.online {
    color: #00ff88;
}

.status-indicator.offline {
    color: #ff4444;
}

.status-indicator.checking {
    color: #ffaa00;
    animation: pulse 2s infinite;
}

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

.version-info {
    color: #666;
    font-size: 0.8rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-body {
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

.modal-footer {
    padding: 20px;
    text-align: right;
    border-top: 1px solid #eee;
}

.modal-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.modal-button:hover {
    background: #0056b3;
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-container {
        padding: 10px;
    }
    
    .login-form {
        padding: 20px;
    }
    
    .login-header {
        padding: 20px;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .floating-numbers span {
        font-size: 1.5rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .login-card {
        background: rgba(30, 30, 30, 0.95);
        color: #fff;
    }
    
    .form-group label {
        color: #fff;
    }
    
    .form-group input {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
    
    .form-group input::placeholder {
        color: rgba(255, 255, 255, 0.6);
    }
    
    .checkbox-container {
        color: #ccc;
    }
    
    .login-footer {
        background-color: rgba(40, 40, 40, 0.8);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .modal-content {
        background-color: #2a2a2a;
        color: #fff;
    }
    
    .modal-body {
        color: #fff;
    }
}