:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --error-color: #dc3545;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1, h2 {
    color: #2c3e50;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.file-drop-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    height: 150px;
    padding: 20px;
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    background-color: rgba(0, 123, 255, 0.05);
    transition: 0.2s;
    box-sizing: border-box;
    cursor: pointer;
}

.file-drop-area:hover, .file-drop-area.is-active {
    background-color: rgba(0, 123, 255, 0.1);
}

.file-msg {
    font-size: 1.1rem;
    color: var(--primary-color);
    pointer-events: none;
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    cursor: pointer;
    opacity: 0;
}

.file-list {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

.btn {
    display: inline-block;
    font-weight: 400;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    margin-top: 1rem;
}

.btn.primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn.primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

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

.status-msg {
    margin-top: 10px;
    font-size: 0.9rem;
}

.status-msg.success { color: var(--success-color); }
.status-msg.error { color: var(--error-color); }

.download-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.download-link {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f1f3f5;
    border-radius: 4px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    transition: background-color 0.2s;
}

.download-link:hover {
    background-color: #e9ecef;
}

/* Connection Wakeup Banner Styles */
.connection-banner {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 3px solid rgba(133, 100, 4, 0.3);
    border-radius: 50%;
    border-top-color: #856404;
    animation: spin 1s ease-in-out infinite;
}

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

.disclaimer-banner {
    background: linear-gradient(135deg, #eef2f7 0%, #e0e8f5 100%);
    border-left: 4px solid #4a90e2;
    color: #2c3e50;
    padding: 0.85rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.warning-banner {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid #d97706;
    color: #92400e;
    padding: 0.85rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.disclaimer-icon {
    margin-right: 10px;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
}

/* Upload Tabs and Info Box Styling */
.upload-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    gap: 15px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease-in-out;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.template-download-box {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: #495057;
}

.template-download-box a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.template-download-box a:hover {
    text-decoration: underline;
}

/* File Upload Badge Styles */
.file-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #f1f3f5;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    margin-top: 15px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.file-item.uploaded {
    background-color: rgba(42, 187, 85, 0.08);
    border-color: #28a745;
    color: #1e7e34;
    font-weight: 600;
    animation: successPulse 1s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.file-status-badge {
    font-size: 0.75rem;
    background-color: #6c757d;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-item.uploaded .file-status-badge {
    background-color: #28a745;
}

@keyframes successPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.5);
        transform: scale(1);
    }
    30% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
        transform: scale(1.04);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
        transform: scale(1);
    }
}

/* UI Config Override Form Styles */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-control {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fcfcfc;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
    background-color: #ffffff;
}

.btn.secondary-btn {
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn.secondary-btn:hover:not(:disabled) {
    background-color: #5a6268;
    border-color: #545b62;
}

.config-container.collapsed {
    max-height: 0 !important;
    margin-top: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.config-container {
    max-height: 1200px;
    opacity: 1;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease-in-out, margin-top 0.4s ease-in-out;
}

/* Credit Key Section Styling */
.credit-section {
    border-left: 4px solid var(--primary-color);
}

.credit-container {
    max-height: 800px;
    opacity: 1;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease-in-out, margin-top 0.4s ease-in-out;
}

.credit-container.collapsed {
    max-height: 0 !important;
    opacity: 0;
    pointer-events: none;
    margin-top: 0 !important;
}

.credit-flow-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .credit-flow-container {
        flex-direction: column;
    }
}

.credit-step-card {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.credit-step-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    border-color: #b8c2cc;
}

.step-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.3);
}

.credit-step-card h3 {
    margin-top: 5px;
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 600;
}

.step-desc {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 15px;
    min-height: 48px;
}

@media (max-width: 768px) {
    .step-desc {
        min-height: auto;
    }
}

.step-btn {
    width: 100%;
    padding: 0.5rem 1rem;
    font-weight: 600;
    margin-top: auto;
}

.credit-status-container {
    margin-top: 20px;
    text-align: center;
    min-height: 24px;
}

#creditKeyStatus {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

#creditKeyStatus.success {
    background-color: #e6f4ea;
    color: #137333;
    border: 1px solid #c2e7c9;
}

#creditKeyStatus.error {
    background-color: #fce8e6;
    color: #c5221f;
    border: 1px solid #fad2cf;
}



