/* Shared styles for tool pages */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: #f8fafc;
}

.container {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    color: #1a202c;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-top: 0;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: #4299e1;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.description {
    color: #718096;
    margin-bottom: 1.5rem;
}

/* Form elements */
form {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

input[type="url"],
input[type="text"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
}

textarea {
    min-height: 400px;
    resize: vertical;
}

input[type="url"]:focus,
input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

/* Buttons */
button {
    background: #4299e1;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

button:hover {
    background: #3182ce;
}

button:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.copy-btn {
    background: #48bb78;
    margin-left: 0.5rem;
}

.copy-btn:hover {
    background: #38a169;
}

/* Result section */
.result-section {
    margin-top: 1.5rem;
    display: none;
}

.result-section.visible {
    display: block;
}

.result-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.result-content {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.result-content.scrollable {
    max-height: 400px;
    overflow-y: auto;
}

/* Error section */
.error {
    background: #fed7d7;
    color: #c53030;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    display: none;
}

/* Examples section */
.examples {
    margin-top: 1rem;
}

.examples h3 {
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.example-link {
    display: block;
    font-size: 0.85rem;
    color: #4299e1;
    text-decoration: none;
    margin-bottom: 0.25rem;
    cursor: pointer;
}

.example-link:hover {
    text-decoration: underline;
}

/* Documentation section */
.docs-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

.docs-section h2 {
    color: #2d3748;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.docs-section h2::before {
    content: '\25b6';
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.docs-section.open h2::before {
    transform: rotate(90deg);
}

.docs-content {
    display: none;
}

.docs-section.open .docs-content {
    display: block;
}

/* Markdown rendering styles in docs */
.docs-content h1 {
    display: none;
}

.docs-content h2 {
    font-size: 1.1rem;
    color: #2d3748;
    margin-top: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.25rem;
}

.docs-content h3 {
    font-size: 1rem;
    color: #4a5568;
    margin-top: 1rem;
}

.docs-content p {
    margin: 0.5rem 0;
}

.docs-content code {
    background: #f7fafc;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85em;
}

.docs-content pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
}

.docs-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.docs-content th,
.docs-content td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem;
    text-align: left;
}

.docs-content th {
    background: #f7fafc;
    font-weight: 600;
}

.docs-content ul,
.docs-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.docs-content li {
    margin: 0.25rem 0;
}
