@import url('index.css');

.tool-page {
    min-height: calc(100vh - 200px);
}

.tool-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 4rem 2rem 3rem;
    position: relative;
    overflow: hidden;
}

.tool-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.tool-title {
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
}

.tool-icon-large {
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.tool-title h1 {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tool-title p {
    font-size: 1.25rem;
    opacity: 0.95;
    line-height: 1.6;
}

.tool-content {
    padding: 3rem 2rem;
    max-width: 100%;
    overflow-x: hidden;
}

.tool-workspace {
    background: var(--white);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    max-width: 100%;
    overflow-x: hidden;
}

.tool-workspace:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.section-header h3 i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.input-section,
.output-section {
    margin-bottom: 2rem;
}

.input-section textarea,
.output-section pre {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    max-width: 100%;
}

.input-section textarea {
    background: var(--light-bg);
}

.input-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.output-section pre {
    background: #1e1e1e;
    color: #d4d4d4;
    overflow-x: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.output-section pre code {
    display: block;
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-clear,
.btn-copy {
    padding: 0.75rem 1.5rem;
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    font-size: 0.9375rem;
    font-weight: 500;
}

.btn-clear:hover {
    background: #fee;
    border-color: #fcc;
    color: #c33;
}

.btn-copy:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.indent-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.indent-control label {
    color: var(--text-dark);
    font-weight: 500;
}

.indent-control select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
}

.indent-control select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Tool Intro Section */
.tool-intro {
    background: var(--white);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.tool-intro h2 {
    font-size: 2.25rem;
    margin-bottom: 1.25rem;
    color: var(--text-dark);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tool-intro h2 i {
    color: var(--primary-color);
    font-size: 2rem;
}

.tool-intro > p {
    font-size: 1.125rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.intro-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.intro-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.intro-card h3 {
    font-size: 1.375rem;
    margin-bottom: 1.25rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
}

.intro-card h3 i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.intro-card ul {
    list-style: none;
    padding: 0;
}

.intro-card ul li {
    color: var(--text-light);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.intro-card ul li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* How It Works Section */
.how-it-works {
    background: var(--white);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.how-it-works h2 {
    font-size: 2.25rem;
    margin-bottom: 2.5rem;
    color: var(--text-dark);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.how-it-works h2 i {
    color: var(--primary-color);
    font-size: 2rem;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.step-content h3 {
    font-size: 1.375rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-weight: 700;
}

.step-content p {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 1.0625rem;
}

/* Examples Section */
.examples {
    background: var(--white);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.examples h2 {
    font-size: 2.25rem;
    margin-bottom: 2.5rem;
    color: var(--text-dark);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.examples h2 i {
    color: var(--primary-color);
    font-size: 2rem;
}

.example-block {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.example-block:last-of-type {
    border-bottom: none;
}

.example-block h3 {
    font-size: 1.375rem;
    margin-bottom: 1.25rem;
    color: var(--text-dark);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.example-block h3 i {
    color: var(--primary-color);
}

.example-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.example-input h4,
.example-output h4 {
    font-size: 1.0625rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.example-input h4 i,
.example-output h4 i {
    color: var(--primary-color);
    font-size: 1rem;
}

.example-input pre,
.example-output pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.25rem;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 0.9375rem;
    line-height: 1.6;
    border: 2px solid #2d2d2d;
    max-width: 100%;
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.common-errors {
    background: #fff3cd;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    margin-top: 2rem;
}

.common-errors h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.common-errors ul {
    list-style: none;
    padding: 0;
}

.common-errors ul li {
    color: #856404;
    padding: 0.5rem 0;
    line-height: 1.6;
}

.common-errors code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

/* When to Use Section */
.when-to-use {
    background: var(--white);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.when-to-use h2 {
    font-size: 2.25rem;
    margin-bottom: 2.5rem;
    color: var(--text-dark);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.when-to-use h2 i {
    color: var(--primary-color);
    font-size: 2rem;
}

.use-cases {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.use-case {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.use-case:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.use-case h3 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
}

.use-case h3 i {
    color: var(--primary-color);
    font-size: 1.375rem;
}

.use-case ul {
    list-style: none;
    padding: 0;
}

.use-case ul li {
    color: var(--text-light);
    padding: 0.5rem 0;
    line-height: 1.6;
}

.use-case ul li:before {
    content: "→";
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* Limitations Section */
.limitations {
    background: linear-gradient(135deg, #fff9e6, #fff3cd);
    padding: 3rem;
    border-radius: 16px;
    border: 2px solid #ffc107;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.15);
}

.limitations h2 {
    font-size: 2.25rem;
    margin-bottom: 2.5rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
}

.limitations h2 i {
    color: #ffc107;
    font-size: 2rem;
}

.limitation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.limitation-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    border-left: 5px solid #ffc107;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.limitation-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.limitation-item h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.limitation-item h3 i {
    color: #ffc107;
}

.limitation-item p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 1rem;
}

.privacy-note {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    border-left: 5px solid #0c5460;
    box-shadow: 0 2px 10px rgba(12, 84, 96, 0.1);
}

.privacy-note p {
    color: #0c5460;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.0625rem;
    font-weight: 600;
}

.privacy-note p i {
    font-size: 1.25rem;
}

/* Related Tools Section */
.related-tools {
    background: var(--white);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.related-tools h2 {
    font-size: 2.25rem;
    margin-bottom: 2.5rem;
    color: var(--text-dark);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.related-tools h2 i {
    color: var(--primary-color);
    font-size: 2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    padding: 2rem;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
    display: block;
    border: 2px solid var(--border-color);
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
    background: var(--white);
    border-color: var(--primary-color);
}

.related-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
    display: block;
}

.related-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-weight: 700;
}

.related-card p {
    color: var(--text-light);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin: 0;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    background: #efe;
    color: #3c3;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1000;
    display: none;
    animation: slideIn 0.3s;
}

.success-message.show {
    display: block;
}

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

@media (max-width: 768px) {
    .tool-header {
        padding: 2.5rem 1rem 2rem;
    }

    .tool-title {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .tool-icon-large {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }

    .tool-title h1 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }

    .tool-title p {
        font-size: 1rem;
    }

    .tool-content {
        padding: 2rem 0rem;
    }

    .tool-workspace {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .section-header h3 {
        font-size: 1.25rem;
    }

    .input-section textarea,
    .output-section pre {
        min-height: 250px;
        font-size: 0.875rem;
        padding: 0.875rem;
        word-break: break-all;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .btn-primary {
        justify-content: center;
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }

    .btn-clear,
    .btn-copy {
        justify-content: center;
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }

    .indent-control {
        width: 100%;
        justify-content: space-between;
    }

    .indent-control select {
        flex: 1;
        max-width: 150px;
    }

    .intro-grid,
    .use-cases,
    .limitation-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .intro-card,
    .use-case,
    .limitation-item {
        padding: 1.5rem;
    }

    .intro-card h3,
    .use-case h3,
    .limitation-item h3 {
        font-size: 1.125rem;
    }

    .example-content {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .example-input pre,
    .example-output pre {
        font-size: 0.8125rem;
        padding: 1rem;
        word-break: break-all;
    }

    .related-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .related-card {
        padding: 1.5rem;
    }

    .related-card i {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .related-card h3 {
        font-size: 1.125rem;
    }

    .tool-intro,
    .how-it-works,
    .examples,
    .when-to-use,
    .limitations,
    .related-tools {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .tool-intro h2,
    .how-it-works h2,
    .examples h2,
    .when-to-use h2,
    .limitations h2,
    .related-tools h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .tool-intro h2 i,
    .how-it-works h2 i,
    .examples h2 i,
    .when-to-use h2 i,
    .limitations h2 i,
    .related-tools h2 i {
        font-size: 1.5rem;
    }

    .tool-intro > p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .step {
        gap: 1rem;
    }

    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .step-content h3 {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }

    .step-content p {
        font-size: 0.9375rem;
    }

    .example-block h3 {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }

    .example-input h4,
    .example-output h4 {
        font-size: 0.9375rem;
        margin-bottom: 0.5rem;
    }

    .common-errors {
        padding: 1.25rem;
        margin-top: 1.5rem;
    }

    .common-errors h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .common-errors ul li {
        font-size: 0.875rem;
        padding: 0.375rem 0;
    }

    .privacy-note {
        padding: 1.25rem 1.5rem;
    }

    .privacy-note p {
        font-size: 0.9375rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .success-message {
        top: 80px;
        right: 10px;
        left: 10px;
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .tool-header {
        padding: 2rem 0.75rem 1.5rem;
    }

    .tool-icon-large {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
        border-radius: 15px;
    }

    .tool-title h1 {
        font-size: 1.5rem;
    }

    .tool-title p {
        font-size: 0.9375rem;
    }

    .tool-content {
        padding: 1.5rem 0rem;
    }

    .tool-workspace {
        padding: 1rem;
    }

    .section-header h3 {
        font-size: 1.125rem;
    }

    .input-section textarea,
    .output-section pre {
        min-height: 200px;
        font-size: 0.8125rem;
        padding: 0.75rem;
        word-break: break-all;
    }

    .btn-primary {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }

    .btn-clear,
    .btn-copy {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .tool-intro,
    .how-it-works,
    .examples,
    .when-to-use,
    .limitations,
    .related-tools {
        padding: 1.25rem;
    }

    .tool-intro h2,
    .how-it-works h2,
    .examples h2,
    .when-to-use h2,
    .limitations h2,
    .related-tools h2 {
        font-size: 1.375rem;
        margin-bottom: 1.25rem;
    }

    .intro-card,
    .use-case,
    .limitation-item,
    .related-card {
        padding: 1.25rem;
    }

    .step-number {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }

    .step-content h3 {
        font-size: 1rem;
    }

    .step-content p {
        font-size: 0.875rem;
    }

    .example-input pre,
    .example-output pre {
        font-size: 0.75rem;
        padding: 0.875rem;
        word-break: break-all;
    }

    .related-card i {
        font-size: 1.75rem;
    }

    .related-card h3 {
        font-size: 1rem;
    }

    .related-card p {
        font-size: 0.875rem;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .tool-header {
        padding: 1.5rem 1rem;
    }

    .tool-title {
        flex-direction: row;
        text-align: left;
        gap: 1.5rem;
    }

    .tool-icon-large {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }

    .tool-title h1 {
        font-size: 1.5rem;
    }

    .input-section textarea,
    .output-section pre {
        min-height: 200px;
    }
}
