/* Main Container */
.wxsgt-main-container {
    max-width: 800px;
    width: 100%;
    margin: 40px auto;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #333;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Header */
.wxsgt-header h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #111827;
    text-align: center;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.wxsgt-description {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 40px;
    text-align: center;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Card Style */
.wxsgt-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin: 0 auto;
    /* Ensure card itself is centered if container is wider */
}

/* Input Groups */
.wxsgt-input-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
}

.wxsgt-input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #374151;
    display: block;
}

.wxsgt-input-group label .required {
    color: #dc2626;
    margin-left: 2px;
}

.wxsgt-input-group input[type="url"],
.wxsgt-input-group select,
.wxsgt-input-group textarea {
    padding: 10px 15px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    line-height: normal !important;
    height: auto !important;
    min-height: 42px !important;
    /* Standard height */
    width: 50% !important;
    /* Reduce width by half */
    max-width: 100% !important;
    box-sizing: border-box !important;
    background-color: #fff !important;
    color: #111827 !important;
    font-family: inherit !important;
    margin: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    display: block !important;
}

/* Force URL input to be wider if needed, but keeping 50% for consistency as requested for "inputs" */
.wxsgt-input-group input[type="url"] {
    width: 100% !important;
    /* URL usually needs full width */
}

/* Add custom arrow for selects since we removed appearance */
.wxsgt-input-group select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.5rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.5em 1.5em !important;
    padding-right: 2.5rem !important;
}

.wxsgt-input-group input[type="url"]:focus,
.wxsgt-input-group select:focus,
.wxsgt-input-group textarea:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.wxsgt-input-group textarea {
    resize: vertical;
}

.wxsgt-helper-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

/* Divider */
.wxsgt-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 30px 0;
}

/* Advanced Toggle */
.wxsgt-advanced-toggle {
    cursor: pointer;
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    margin-bottom: 24px;
}

.wxsgt-advanced-toggle:hover {
    color: #111827;
}

.toggle-icon {
    font-size: 10px;
    transition: transform 0.2s;
}

.wxsgt-advanced-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.wxsgt-advanced-options {
    display: none;
    /* Controlled by JS */
}

/* Actions Buttons */
.wxsgt-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
}

.wxsgt-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.wxsgt-btn-outline {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.wxsgt-btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.wxsgt-btn-primary {
    background: #2563eb;
    border: 1px solid transparent;
    color: white;
}

.wxsgt-btn-primary:hover {
    background: #1d4ed8;
}

/* Loading */
#wxsgt-loading {
    text-align: center;
    padding: 40px 0;
}

.wxsgt-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Result Area */
#wxsgt-result h3 {
    margin-top: 20px;
    font-size: 18px;
    color: #111827;
}

.wxsgt-stats {
    background: #eff6ff;
    color: #1e40af;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
}

.wxsgt-pre-wrapper {
    position: relative;
    margin-bottom: 20px;
}

#wxsgt-output {
    background: #1f2937;
    color: #e5e7eb;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    max-height: 400px;
    white-space: pre-wrap;
}

#wxsgt-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

#wxsgt-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wxsgt-result-actions {
    text-align: right;
}

@media (max-width: 600px) {
    .wxsgt-card {
        padding: 20px;
    }
}