/* ==========================================
   CSS Variables - Design System
   ========================================== */
:root {
    /* Primary Colors */
    --color-primary: #28a745;
    --color-primary-dark: #218838;
    --color-secondary: #007bff;
    --color-secondary-dark: #0056b3;

    /* Status Colors */
    --color-danger: #dc3545;
    --color-warning: #ffc107;
    --color-warning-dark: #e0a800;
    --color-success: #28a745;
    --color-info: #17a2b8;

    /* Neutral Colors */
    --color-light: #f8f9fa;
    --color-dark: #343a40;
    --color-gray: #999;

    /* Design Tokens */
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   Base Styles
   ========================================== */
* {
    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%);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ==========================================
   Container
   ========================================== */
.container {
    background-color: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 550px;
    text-align: center;
    position: relative;
    z-index: 10;
}

/* ==========================================
   Typography
   ========================================== */
h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
    font-weight: 700;
}

.subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 30px;
}

/* ==========================================
   Status Badge
   ========================================== */
.status-container {
    margin-bottom: 25px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.status-badge:hover::before {
    left: 100%;
}

.status-badge.online {
    color: #fff;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.status-badge.offline {
    color: #fff;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.status-badge.run_locally {
    color: #fff;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.status-badge.loading {
    color: #fff;
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.status-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: currentColor;
    animation: pulse 2s infinite;
}

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

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 15px;
    transition: var(--transition);
    background-color: #fff;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

input:disabled, select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

input::placeholder {
    color: #aaa;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.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;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #0056b3 100%);
    color: white;
    margin-top: 12px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.btn-connect {
    background: linear-gradient(135deg, var(--color-warning) 0%, var(--color-warning-dark) 100%);
    color: #333;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-connect:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

/* ==========================================
   Spinner
   ========================================== */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-left-color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================
   Feedback Messages
   ========================================== */
.feedback {
    margin-top: 24px;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: left;
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid;
}

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

.feedback.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #28a745;
}

.feedback.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #dc3545;
}

.feedback.info {
    color: #004085;
    background-color: #cce5ff;
    border-color: #007bff;
}

/* ==========================================
   PIM Upload Status
   ========================================== */
.pim-status {
    font-size: 14px;
    font-weight: 600;
    padding: 14px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    text-align: center;
    border: 2px solid;
}

.pim-status.activated {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #dc3545;
}

.pim-status.deactivated {
    color: #856404;
    border-color: #ffc107;
    animation: soft-blink 2s ease-in-out infinite;
}

@keyframes soft-blink {
    0%, 100% {
        background-color: #fff3cd;
        transform: scale(1);
    }
    50% {
        background-color: #ffe8a1;
        transform: scale(1.02);
    }
}

/* ==========================================
   Version Info
   ========================================== */
.version-info {
    font-size: 13px;
    color: var(--color-gray);
    margin-top: 30px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
}

.version-info:hover {
    color: var(--color-secondary);
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

/* ==========================================
   Action Buttons Container
   ========================================== */
.action-buttons {
    margin-top: 24px;
}

/* ==========================================
   Vue Transitions
   ========================================== */
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fade-enter-from, .fade-leave-to {
    opacity: 0;
    transform: translateY(-10px);
}

/* ==========================================
   Progress Indicator
   ========================================== */
.progress-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ddd;
    transition: var(--transition);
}

.progress-dot.active {
    background-color: var(--color-secondary);
    transform: scale(1.3);
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
    }

    h1 {
        font-size: 24px;
    }
}