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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    padding: 20px;
    color: #1f2937;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

header {
    background: #1e40af;
    color: white;
    padding: 48px 40px;
    text-align: center;
    border-bottom: 1px solid #1e3a8a;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    color: #e0e7ff;
}

.steps-info {
    background: #f9fafb;
    padding: 32px 40px;
    border-bottom: 1px solid #e5e7eb;
}

.steps-info h2 {
    color: #1e40af;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
}

.steps-info h3 {
    color: #1e40af;
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: 600;
}

.steps-info h3:first-of-type {
    margin-top: 0;
}

.steps-info .instructions {
    line-height: 1.8;
}

.steps-info .instructions p {
    margin-bottom: 12px;
    color: #555;
}

.steps-info .instructions ul {
    margin-left: 25px;
    margin-bottom: 15px;
    color: #555;
}

.steps-info .instructions li {
    margin-bottom: 8px;
}

.steps-info .instructions code {
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #dc2626;
    font-weight: 500;
}

.steps-info .important-note {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 16px;
    margin-top: 20px;
    border-radius: 6px;
    color: #92400e;
}

.steps-info .important-note strong {
    color: #856404;
}

.screenshot-container {
    margin: 20px 0;
    text-align: center;
}

.screenshot {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    margin-bottom: 10px;
}

.screenshot-caption {
    font-size: 0.9em;
    color: #6b7280;
    font-style: italic;
    margin-top: 8px;
}

.converter-section {
    padding: 40px;
}

.input-section,
.options-section,
.action-section,
.output-section {
    margin-bottom: 30px;
}

h2 {
    color: #1e40af;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
}

.input-options {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.file-upload {
    position: relative;
    display: inline-block;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.upload-button,
.paste-button {
    display: inline-block;
    padding: 12px 24px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.2s ease;
}

.upload-button:hover,
.paste-button:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.divider {
    color: #999;
    font-weight: 500;
}

#xmlInput {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
}

#xmlInput:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.help-text {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.rule-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.rule-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #555;
}

.rule-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2563eb;
}

.rule-checkboxes input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.rule-checkboxes label.disabled {
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.grouping-section {
    margin-top: 20px;
}

.grouping-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.grouping-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    max-width: 500px;
}

.grouping-section input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
}

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

.generate-guid-button {
    padding: 10px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.generate-guid-button:hover {
    background: #1d4ed8;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.generate-guid-button:active {
    transform: scale(0.98);
}

.generate-guid-button.generated {
    background: #059669;
}

.help-text-small {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #999;
}

.action-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.convert-button,
.download-button {
    padding: 15px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.convert-button {
    background: #2563eb;
    color: white;
}

.convert-button:hover:not(:disabled) {
    background: #1d4ed8;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.convert-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.download-button {
    background: #059669;
    color: white;
}

.download-button:hover:not(:disabled) {
    background: #047857;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.download-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.output-section {
    background: #f9fafb;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.output-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.copy-button,
.clear-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.copy-button {
    background: #0891b2;
    color: white;
}

.copy-button:hover {
    background: #0e7490;
}

.clear-button {
    background: #dc2626;
    color: white;
}

.clear-button:hover {
    background: #b91c1c;
}

#output {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
}

#output code {
    display: block;
    white-space: pre;
}

.error-section {
    margin-top: 20px;
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
}

.error-message {
    font-weight: 500;
}

footer {
    background: #f9fafb;
    padding: 32px 40px;
    text-align: center;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
}

footer p {
    margin-bottom: 10px;
}

.docs-link a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.docs-link a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .converter-section {
        padding: 20px;
    }

    .input-options {
        flex-direction: column;
        align-items: stretch;
    }

    .divider {
        text-align: center;
    }

    .action-section {
        flex-direction: column;
    }

    .convert-button,
    .download-button {
        width: 100%;
    }
}

