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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

header {
    margin-bottom: 2rem;
    color: white;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.header-left {
    flex: 1;
}

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

.user-info {
    text-align: right;
    font-size: 0.9rem;
}

.username {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.role {
    display: block;
    opacity: 0.8;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 i {
    margin-right: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Upload Area Styles */
.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f7fafc;
}

.upload-area:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e6fffa;
    transform: scale(1.02);
}

.upload-content i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.upload-content p {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.browse-link {
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.upload-content small {
    color: #718096;
    font-size: 0.9rem;
}

/* File List Styles */
.file-list {
    margin-top: 1.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: #edf2f7;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    font-size: 1.5rem;
    color: #667eea;
}

.file-details h4 {
    font-size: 1rem;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.file-details small {
    color: #718096;
    font-size: 0.875rem;
}

.file-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.status-icon.success {
    color: #48bb78;
}

.status-icon.error {
    color: #f56565;
}

.status-icon.loading {
    color: #4299e1;
    animation: spin 1s linear infinite;
}

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

/* Progress Bar Styles */
.progress-container {
    margin-top: 1.5rem;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

#progressText {
    color: #4a5568;
    font-weight: 500;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="text"].error {
    border-color: #f56565;
    background: #fed7d7;
}

.error-message {
    color: #f56565;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.2rem;
}

.warning-message {
    color: #b7791f;
    background: #fefcbf;
    border: 1px solid #f6e05e;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
    font-size: 0.95em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.warning-message i {
    color: #b7791f;
    font-size: 1.1em;
}

/* JSON warning color */
.json-warning pre {
    color: #e53e3e !important;
}

/* Copy JSON button */
#copyJsonBtn {
    margin-bottom: 1rem;
    float: right;
    background: #edf2f7;
    color: #2d3748;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    padding: 0.4rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
#copyJsonBtn:hover {
    background: #e2e8f0;
}

/* Checkbox Styles */
.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #4a5568;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.875rem;
    font-weight: bold;
}

/* JSON Preview Styles */
.json-container {
    background: #1a202c;
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.json-container pre {
    color: #e2e8f0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.validation-status {
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.validation-status.valid {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.validation-status.invalid {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

/* Webhook Config Styles */
.webhook-config {
    margin-bottom: 1.5rem;
}

.webhook-config label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
}

.webhook-config input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.webhook-config input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Button Styles */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 200px;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.3);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    max-width: 400px;
    word-wrap: break-word;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast.success {
    background: #48bb78;
}

.toast.error {
    background: #f56565;
}

.toast.info {
    background: #4299e1;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-content i {
        font-size: 2.5rem;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .file-status {
        align-self: flex-end;
    }
    
    .btn {
        width: 100%;
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
    }
    
    .toast {
        max-width: none;
    }
}

/* Telegram Mini App Optimizations */
@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .upload-area {
        padding: 1.5rem 1rem;
    }
    
    .upload-content i {
        font-size: 2rem;
    }
    
    .form-grid {
        gap: 1rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Error Help Section Styles */
.error-help-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.error-type {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
}

.error-type h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-type h3 i {
    color: #667eea;
}

.error-type p {
    color: #4a5568;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.error-type ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-type li {
    color: #718096;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.error-type li::before {
    content: '•';
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.error-type a {
    color: #667eea;
    text-decoration: underline;
    font-weight: 500;
}

.error-type a:hover {
    color: #5a67d8;
}

#retryBtn {
    align-self: center;
    margin-top: 1rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mt-2 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 1rem;
} 

.actions#fileActions {
    margin-top: 1rem;
    margin-bottom: 0;
    gap: 1rem;
} 

.json-error-value {
    color: #e53e3e;
    font-weight: bold;
    background: #fff5f5;
    border-radius: 4px;
    padding: 0 2px;
}
.json-warning-value {
    color: #b7791f;
    font-weight: bold;
    background: #fefcbf;
    border-radius: 4px;
    padding: 0 2px;
} 

.manual-entry-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* Footer Styles */
.footer {
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 0.875rem;
    font-weight: 500;
}

.footer p {
    margin: 0;
    padding: 0;
}

/* App Footer Styles */
.app-footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    margin-top: 2rem;
    text-align: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    margin: 0;
    padding: 0;
    opacity: 0.9;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Response Section Styles */
.response-status {
    margin-bottom: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 500;
}

.status-indicator.loading {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-indicator.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-indicator.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.response-container {
    margin-bottom: 1rem;
}

.response-container pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.response-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

.response-actions .btn {
    min-width: 120px;
}

/* Virtual Accounts Section Styles */
.accounts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.accounts-status {
    flex: 1;
}

.accounts-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Search and Filter Styles */
.accounts-search-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.search-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input-group {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input-group i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    transition: border-color 0.15s ease-in-out;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.filter-select {
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    min-width: 120px;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-outline {
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-outline:hover {
    background: #6c757d;
    color: white;
}

.search-results-info {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Row Copy Button */
.row-copy-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    white-space: nowrap;
}

.row-copy-btn:hover {
    background: #218838;
}

.row-copy-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.row-copy-btn i {
    margin-right: 0.25rem;
}

.accounts-table-container {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.accounts-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.875rem;
}

.accounts-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.accounts-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.accounts-table td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.accounts-table tbody tr:hover {
    background: #f8f9fa;
}

.accounts-table tbody tr:last-child td {
    border-bottom: none;
}

.account-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.account-status-badge.active {
    background: #d4edda;
    color: #155724;
}

.account-status-badge.closed {
    background: #f8d7da;
    color: #721c24;
}

.account-status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.account-status-badge.unknown {
    background: #e9ecef;
    color: #6c757d;
}

.account-data-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #495057;
    word-break: break-all;
    max-width: 200px;
}

.owner-name-cell {
    font-weight: 500;
    color: #2d3748;
    max-width: 200px;
}

@media (max-width: 768px) {
    .accounts-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .accounts-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .accounts-table-container {
        font-size: 0.75rem;
    }
    
    .accounts-table th,
    .accounts-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .account-data-cell {
        max-width: 120px;
        font-size: 0.7rem;
    }
} 