/**
 * Vue.js Settings Styles
 */

.einvmylhdn-settings-app {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.einvmylhdn-unsaved-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 20px;
}


/* Messages */
.einvmylhdn-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    animation: slideInDown 0.3s ease;
}

.einvmylhdn-message-success {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

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

.einvmylhdn-message-info {
    background: #cce7ff;
    color: #004085;
    border: 1px solid #99d3ff;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -100%, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Settings Sections */
.einvmylhdn-settings-section {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    margin-bottom: 20px;
}

.einvmylhdn-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 12px 16px;
    border-bottom: 1px solid #e1e5e9;
}

.einvmylhdn-section-title {
    color: #333;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.einvmylhdn-section-actions {
    flex-shrink: 0;
    margin-left: 16px;
}

.einvmylhdn-section-description {
    padding: 12px 16px;
    color: #666;
    margin: 0;
    font-size: 13px;
    border-bottom: 1px solid #f1f3f4;
    background: #fafbfc;
}

.einvmylhdn-section-content {
    padding: 16px;
}

/* Form Grid */
.einvmylhdn-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Status Grid */
.einvmylhdn-status-grid {
    display: grid;
    gap: 16px;
}

.einvmylhdn-status-item {
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.einvmylhdn-status-label {
    font-weight: 600;
    color: #333;
    margin: 0;
}

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

.einvmylhdn-status-icon {
    font-size: 16px;
}

.einvmylhdn-status-success {
    color: #28a745;
}

.einvmylhdn-status-error {
    color: #dc3545;
}

.einvmylhdn-status-warning {
    color: #ffc107;
}


/* Field Groups */
.einvmylhdn-field-group {
    margin-bottom: 20px;
}

.einvmylhdn-field-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.einvmylhdn-required {
    color: #dc3545;
    margin-left: 4px;
}

/* Form Controls */
.einvmylhdn-input,
.einvmylhdn-textarea,
.einvmylhdn-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #fff;
}

/* Input Wrapper for Password Toggle */
.einvmylhdn-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.einvmylhdn-input-wrapper .einvmylhdn-input.has-toggle,
.einvmylhdn-input-wrapper .einvmylhdn-input.has-suffix {
    padding-right: 32px;
}

.einvmylhdn-password-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.einvmylhdn-password-toggle:hover {
    color: #495057;
}

.einvmylhdn-password-toggle i {
    font-size: 16px;
}

/* Suffix Action Button */
.einvmylhdn-suffix-action {
    position: absolute;
    right: 2px;
    background: #2196f3;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: white;
    display: flex;
    justify-content: center;
    transition: background-color 0.2s ease;
    border-bottom-right-radius: 3px;
    border-top-right-radius: 3px;
    width: 26px;
    height: 28px;
}

.einvmylhdn-suffix-action:hover:not(:disabled) {
    background: #1976d2;
}

.einvmylhdn-suffix-action:disabled {
    background: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
}

.einvmylhdn-suffix-action i {
    font-size: 14px;
}

.einvmylhdn-suffix-action .einvmylhdn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
}

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

.einvmylhdn-input:invalid,
.einvmylhdn-textarea:invalid,
.einvmylhdn-select:invalid {
    border-color: #dc3545;
}

.einvmylhdn-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkbox */
.einvmylhdn-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.einvmylhdn-checkbox {
    width: auto !important;
    margin-right: 8px;
    transform: scale(1.2);
}

/* Field Description */
.einvmylhdn-field-description {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

/* Info Box */
.einvmylhdn-info-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-left: 3px solid #2196f3;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
}

.einvmylhdn-info-icon {
    flex-shrink: 0;
    color: #2196f3;
    font-size: 16px;
    margin-top: 1px;
}

.einvmylhdn-info-content {
    flex: 1;
}

.einvmylhdn-info-content h4 {
    margin: 0 0 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: #1565c0;
}

.einvmylhdn-info-content p {
    margin: 0;
    font-size: 12px;
    color: #1976d2;
    line-height: 1.4;
}

.einvmylhdn-info-actions {
    flex-shrink: 0;
    margin-left: auto;
}

.einvmylhdn-info-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #1976d2;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 3px;
    border: 1px solid rgba(33, 150, 243, 0.2);
    transition: all 0.2s ease;
}

.einvmylhdn-info-link:hover {
    background: rgba(33, 150, 243, 0.15);
    border-color: rgba(33, 150, 243, 0.3);
    text-decoration: none;
    color: #1565c0;
    transform: translateY(-1px);
}

.einvmylhdn-info-link i {
    font-size: 11px;
}

/* API Key Section */
.einvmylhdn-api-key-section {
    margin-bottom: 16px;
}

.einvmylhdn-api-key-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.einvmylhdn-api-save-btn {
    min-width: 120px;
    font-size: 13px;
    padding: 8px 16px;
}

.einvmylhdn-header-save-btn {
    min-width: 100px;
    font-size: 12px;
    padding: 8px 18px !important;
    margin: 0;
}

.einvmylhdn-header-test-btn {
    min-width: 110px;
    font-size: 12px;
    padding: 8px 18px !important;
    margin: 0;
}

/* Warning Notice */
.einvmylhdn-warning-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    padding: 12px;
    margin-top: 12px;
}

.einvmylhdn-warning-icon {
    flex-shrink: 0;
    color: #856404;
    font-size: 18px;
    margin-top: 1px;
}

.einvmylhdn-warning-content {
    flex: 1;
    min-width: 0;
}

.einvmylhdn-warning-content h4 {
    margin: 0 0 2px 0;
    font-size: 14px;
    font-weight: 600;
    color: #856404;
    line-height: 1.3;
}

.einvmylhdn-warning-content p {
    margin: 0;
    font-size: 13px;
    color: #856404;
    line-height: 1.3;
}

/* Success Notice */
.einvmylhdn-success-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-left: 4px solid #28a745;
    border-radius: 4px;
    padding: 12px;
    margin-top: 12px;
}

.einvmylhdn-success-notice + .einvmylhdn-success-notice {
    margin-top: 8px;
}

.einvmylhdn-success-icon {
    flex-shrink: 0;
    color: #28a745;
    font-size: 18px;
    margin-top: 1px;
}

.einvmylhdn-success-content {
    flex: 1;
    min-width: 0;
}

.einvmylhdn-success-content h4 {
    margin: 0 0 2px 0;
    font-size: 14px;
    font-weight: 600;
    color: #155724;
    line-height: 1.3;
}

.einvmylhdn-success-content p {
    margin: 0;
    font-size: 13px;
    color: #0c5460;
    line-height: 1.3;
}

.einvmylhdn-last-checked {
    margin-top: 8px !important;
    font-size: 12px !important;
    color: #6c757d !important;
    opacity: 0.8;
}

.einvmylhdn-cached-indicator {
    color: #28a745;
    font-weight: 600;
}

/* Connection Test Message */
.einvmylhdn-connection-test-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid;
}

.einvmylhdn-connection-test-message.success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.einvmylhdn-connection-test-message.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* TIN Search Section */
.einvmylhdn-tin-section {
    margin-bottom: 16px;
}

.einvmylhdn-tin-search-message {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid;
}

.einvmylhdn-tin-search-message.success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.einvmylhdn-tin-search-message.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}


/* Step Actions */
.einvmylhdn-step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-top: 2px solid #f8f9fa;
    margin-top: 24px;
}

.einvmylhdn-step-info {
    font-weight: 600;
    color: #6c757d;
    font-size: 14px;
}

.einvmylhdn-additional-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid #e9ecef;
}

.einvmylhdn-auto-save-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #ffc107;
    font-weight: 500;
}

/* Buttons */
.einvmylhdn-form-actions {
    display: flex;
    gap: 12px;
    padding-top: 24px;
    border-top: 2px solid #f8f9fa;
    margin-top: 24px;
}

.einvmylhdn-button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.einvmylhdn-button-primary {
    background: #0073aa;
    color: #fff;
}

.einvmylhdn-button-primary:hover:not(:disabled) {
    background: #005a87;
}

.einvmylhdn-button-secondary {
    background: #f1f1f1;
    color: #333;
    border: 1px solid #ccc;
}

.einvmylhdn-button-secondary:hover:not(:disabled) {
    background: #e6e6e6;
}

.einvmylhdn-button-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.einvmylhdn-button-outline:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.einvmylhdn-button-success {
    background: #28a745;
    color: white;
}

.einvmylhdn-button-success:hover:not(:disabled) {
    background: #218838;
}

.einvmylhdn-button-link {
    background: transparent;
    color: #6c757d;
    padding: 8px 12px;
    font-size: 12px;
}

.einvmylhdn-button-link:hover:not(:disabled) {
    color: #495057;
    background: #f8f9fa;
}

/* Form Container */
.einvmylhdn-form-container {
    background: white;
}

/* Spinner */
.einvmylhdn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .einvmylhdn-form-grid {
        grid-template-columns: 1fr;
    }
    
    .einvmylhdn-form-actions {
        flex-direction: column;
    }
    
    .einvmylhdn-button {
        width: 100%;
        justify-content: center;
    }
}

/* Form Validation States */
.einvmylhdn-input.invalid,
.einvmylhdn-textarea.invalid,
.einvmylhdn-select.invalid {
    border-color: #dc3545;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Loading State */
.einvmylhdn-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.einvmylhdn-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Floating Actions */
.einvmylhdn-floating-actions {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.einvmylhdn-floating-button {
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.einvmylhdn-floating-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.einvmylhdn-floating-button i {
    margin-right: 8px;
}

/* Responsive floating buttons */
@media (max-width: 768px) {
    .einvmylhdn-floating-actions {
        bottom: 10px;
        right: 10px;
        left: 10px;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .einvmylhdn-floating-button {
        min-width: auto;
        flex: 1;
        margin: 0 5px;
    }
}