:root {
    --primary-color: #006837;
    --primary-light: #008542;
    --primary-dark: #004d2b;
    --secondary-color: #00a651;
    --accent-color: #3399ff;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --teal: #0d7377;
    --teal-light: #14a3a8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8faf9;
    --bg-tertiary: #f0f5f2;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

html {
    overflow-x: hidden;
}

body {
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-height);
    line-height: 1.7;
    overflow-x: hidden;
    max-width: 100vw;
}

header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color), var(--primary-light));
    padding: 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(3px);
}

.header-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-title i {
    margin-left: 0.5rem;
}

.logo {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    height: 45px;
    width: auto;
}

.table-of-contents {
    max-width: 1000px;
    margin: 1.5rem auto 0;
    padding: 0 1rem;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid var(--border-color);
    border-bottom: 2px solid var(--primary-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.toc-header:hover {
    background: var(--bg-tertiary);
}

.toc-header h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.toc-header h3 i {
    margin-left: 0.5rem;
}

.toc-toggle-icon {
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.toc-toggle-icon.rotated {
    transform: rotate(180deg);
}

.toc-list {
    list-style: none;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.toc-list.collapsed {
    max-height: 0 !important;
    border: none;
}

.toc-list li {
    border-bottom: 1px solid var(--bg-tertiary);
}

.toc-list li:last-child {
    border-bottom: none;
}

.toc-list a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.toc-list a:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    padding-right: 2rem;
}

.toc-list a i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.help-container {
    max-width: 1000px;
    margin: 1.5rem auto;
    padding: 0 1rem 2rem;
    flex: 1;
}

.help-section {
    background: white;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}

.help-section:hover {
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--bg-tertiary), white);
    border-bottom: 2px solid var(--primary-color);
}

.section-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 700;
    min-width: 0;
    word-wrap: break-word;
}

.section-body {
    padding: 1.5rem;
    overflow: hidden;
}

.intro-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.step-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.step-number {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.step:last-child .step-content {
    border-bottom: none;
    padding-bottom: 0;
}

.step-content h4 {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.step-content p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.step-content ol,
.step-content ul {
    padding-right: 1.5rem;
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.step-content li {
    margin-bottom: 0.35rem;
    line-height: 1.7;
}

.step-content code {
    background: var(--bg-tertiary);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--teal);
    direction: ltr;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-all;
}

.step-content a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    word-break: break-all;
}

.step-content a:hover {
    text-decoration: underline;
}

.info-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1rem 0;
    border-right: 4px solid var(--primary-color);
    overflow: hidden;
}

.info-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.info-card h4 i {
    margin-left: 0.5rem;
}

.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 1rem;
}

.part-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.part-card:hover {
    transform: translateY(-2px);
}

.part-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: white;
    font-size: 1.3rem;
}

.part-card h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.part-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.warning-box {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

.warning-box > i {
    color: var(--warning-color);
    font-size: 1.3rem;
    margin-top: 3px;
    flex-shrink: 0;
}

.warning-box strong {
    color: #e65100;
}

.tip-box {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin: 0.75rem 0;
    font-size: 0.92rem;
}

.tip-box > i {
    color: var(--success-color);
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.tip-box a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.tip-box a:hover {
    text-decoration: underline;
}

.code-block-wrapper {
    margin: 1rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid #334155;
    box-shadow: var(--shadow-md);
    max-width: 100%;
}

.code-block-wrapper.small {
    margin: 0.75rem 0;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #1e293b;
    color: #94a3b8;
    font-size: 0.85rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.code-block-header span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.copy-btn.copied {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
    color: #81c784;
}

.code-block {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1.25rem;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    direction: ltr;
    text-align: left;
    white-space: pre;
    tab-size: 2;
    max-height: 500px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.code-block::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.code-block::-webkit-scrollbar-track {
    background: #1e293b;
}

.code-block::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 1rem;
}

.feature-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    overflow: hidden;
}

.feature-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.feature-card.highlight-green {
    border-right: 4px solid var(--primary-color);
}

.feature-card.highlight-teal {
    border-right: 4px solid var(--teal);
}

.feature-card.highlight-blue {
    border-right: 4px solid var(--accent-color);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.feature-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.feature-card small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.example-block {
    display: block;
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    direction: ltr;
    text-align: left;
    white-space: pre-line;
    color: var(--teal);
    border: 1px solid var(--border-color);
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
}

.smtp-providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 1rem;
}

.provider-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.provider-card h5 {
    font-size: 0.95rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bg-tertiary);
}

.provider-card ul {
    list-style: none;
    font-size: 0.88rem;
}

.provider-card li {
    padding: 0.2rem 0;
    color: var(--text-secondary);
}

.provider-card li strong {
    color: var(--text-primary);
}

.provider-card li code {
    background: var(--bg-tertiary);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.82rem;
    direction: ltr;
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
}

.provider-card small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: 1rem;
}

.compare-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.compare-card h5 {
    font-size: 0.95rem;
    color: var(--teal);
    margin-bottom: 0.5rem;
}

.compare-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.feature-list {
    list-style: none;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list li i {
    color: var(--primary-color);
    margin-top: 4px;
    width: 18px;
    flex-shrink: 0;
}

.subsection {
    margin: 1rem 0;
}

.subsection h3 {
    font-size: 1.05rem;
    color: var(--teal);
    margin-bottom: 1rem;
}

.subsection h3 i {
    margin-left: 0.5rem;
}

.status-preview {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.status-preview code,
.status-preview p {
    direction: ltr;
    word-break: break-all;
}

footer {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: white;
    text-align: center;
    padding: 1.25rem;
    font-size: 0.9rem;
}

.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-top-btn.visible {
    display: flex;
}

.scroll-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.toast {
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 10000;
    transition: transform 0.4s ease;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.toast.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }

    .header-title {
        font-size: 1rem;
    }

    .logo img {
        height: 35px;
    }

    .section-header {
        padding: 1rem;
        gap: 0.75rem;
    }

    .section-header h2 {
        font-size: 1.1rem;
    }

    .section-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .section-body {
        padding: 1rem;
    }

    .info-card {
        padding: 1rem;
    }

    .parts-grid,
    .feature-grid,
    .smtp-providers-grid,
    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .step {
        gap: 0.75rem;
    }

    .step-number {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 0.95rem;
    }

    .step-content ol,
    .step-content ul {
        padding-right: 1.25rem;
    }

    .code-block {
        font-size: 0.78rem;
        padding: 1rem;
    }

    .code-block-header {
        padding: 0.6rem 0.75rem;
        font-size: 0.78rem;
    }

    .code-block-header span {
        flex: 1;
        min-width: 0;
        word-break: break-word;
    }

    .warning-box {
        padding: 0.85rem 1rem;
    }

    .tip-box {
        padding: 0.75rem 0.85rem;
    }

    .scroll-top-btn {
        bottom: 1.5rem;
        left: 1.5rem;
        width: 42px;
        height: 42px;
    }

    .table-of-contents {
        margin-top: 1rem;
    }

    .toc-header {
        padding: 0.85rem 1rem;
    }

    .help-container {
        padding: 0 0.75rem 2rem;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 60px;
    }

    .header-content {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    .header-title {
        font-size: 0.85rem;
    }

    .header-right {
        gap: 0.5rem;
    }

    .back-btn {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .logo img {
        height: 30px;
    }

    .toc-list a {
        padding: 0.7rem 1rem;
        font-size: 0.88rem;
    }

    .section-header {
        padding: 0.85rem 0.75rem;
        gap: 0.6rem;
    }

    .section-header h2 {
        font-size: 1rem;
    }

    .section-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .section-body {
        padding: 0.85rem 0.75rem;
        max-width: 400px;
    }

    .intro-text {
        font-size: 0.95rem;
    }

    .info-card {
        padding: 0.85rem;
        border-right-width: 3px;
    }

    .step-number {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 0.85rem;
    }

    .step {
        gap: 0.6rem;
    }

    .step-content h4 {
        font-size: 0.95rem;
    }

    .step-content p,
    .step-content li {
        font-size: 0.9rem;
    }

    .step-content code {
        font-size: 0.8rem;
        padding: 0.1rem 0.35rem;
    }

    .code-block {
        font-size: 0.72rem;
        padding: 0.75rem;
    }

    .code-block-header {
        padding: 0.5rem 0.65rem;
        font-size: 0.72rem;
    }

    .copy-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .feature-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .feature-card h4 {
        font-size: 0.92rem;
    }

    .feature-card p {
        font-size: 0.85rem;
    }

    .part-icon {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }

    .warning-box {
        padding: 0.75rem 0.85rem;
        gap: 0.6rem;
    }

    .warning-box > i {
        font-size: 1.1rem;
    }

    .tip-box {
        padding: 0.65rem 0.75rem;
        font-size: 0.85rem;
        gap: 0.6rem;
    }

    .table-of-contents {
        padding: 0 0.5rem;
        margin-top: 0.75rem;
    }

    .toc-header {
        padding: 0.75rem 0.85rem;
    }

    .toc-header h3 {
        font-size: 0.95rem;
    }

    .help-container {
        margin-top: 1rem;
        padding: 0 0.5rem 1.5rem;
    }

    .help-section {
        border-radius: var(--radius-md);
        margin-bottom: 1rem;
    }

    .provider-card {
        padding: 0.85rem;
    }

    .provider-card h5 {
        font-size: 0.88rem;
    }

    .provider-card ul {
        font-size: 0.82rem;
    }

    .toast {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    .scroll-top-btn {
        bottom: 1rem;
        left: 1rem;
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    footer {
        padding: 1rem;
        font-size: 0.82rem;
    }
}
