/* ========== AtomLeap.ai Legal Pages Stylesheet ========== */
/* Version: 1.0 | Created: 2024 | For: Legal/Privacy Policy Pages */

/* --- Base Styles --- */
body {
    font-family: 'DM Sans', Arial, sans-serif;
    background: #f7f9fb;
    color: #23263a;
    margin: 0;
    padding: 0;
    line-height: 1.7;
}

/* --- Main Container --- */
.blog-post,
.tos-container {
    max-width: 1000px;
    margin: 3rem auto 2.5rem auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(76, 115, 245, 0.07), 0 1.5px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    padding: 2.5rem 2.2rem 2.5rem 2.2rem;
    text-align: left;
}

/* --- Typography --- */
.blog-title,
.blog-post h1 {
    font-size: 2.3rem;
    font-weight: 800;
    color: #4c73f5;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 0.7rem;
    letter-spacing: -0.01em;
    text-align: left;
}

.meta {
    color: #7a869a;
    font-size: 0.98rem;
    margin-bottom: 0.2rem;
    text-align: left;
}

/* --- Page Title and Meta --- */
.tos-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #203a2d;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
    text-align: left;
}

.tos-meta {
    color: #7a869a;
    font-size: 0.7rem;
    margin-bottom: 2.2rem;
    text-align: left;
    line-height: 1.7;
}

.tos-meta b {
    font-weight: 600;
}

/* --- Section Headings --- */
.tos-section-title,
.tos-subsection-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #69b8bf;
    margin-bottom: 0.7rem;
    margin-top: 2.2em;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.2em;
    letter-spacing: 0.01em;
}

/* --- Content Elements --- */
.blog-post p,
.blog-post ul,
.blog-post table,
.tos-container p,
.tos-container ul,
.tos-container table {
    margin-bottom: 1.1em;
}

.blog-post ul,
.tos-container ul {
    margin-left: 1.5em;
    list-style: disc;
}

.blog-post li,
.tos-container li {
    margin-bottom: 0.4em;
}

.blog-post a,
.tos-container a {
    color: #4c73f5;
    text-decoration: underline;
    transition: color 0.2s;
}

.blog-post a:hover,
.tos-container a:hover {
    color: #203a2d;
}

/* --- Table Styles --- */
.blog-post table,
.tos-container table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(76, 115, 245, 0.06);
    border: 3px solid #e5e7eb;
    table-layout: auto;
    margin-bottom: 1.1em;
}

.blog-post thead th,
.tos-container th {
    background: #e6f0ff;
    color: #203a2d;
    font-weight: 700;
    padding: 14px 10px;
    border-bottom: 2px solid #b0c4de;
    font-size: 1rem;
    text-align: left;
    vertical-align: middle;
    min-width: 110px;
    word-break: break-word;
}

.blog-post tbody td,
.tos-container td {
    padding: 12px 10px;
    color: #333;
    font-size: 0.98rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    word-break: break-word;
    min-width: 110px;
    box-sizing: border-box;
}

.blog-post tr:last-child td,
.tos-container tr:last-child td {
    border-bottom: none;
}

.blog-post th,
.blog-post td,
.tos-container th,
.tos-container td {
    border-right: 1px solid #e5e7eb;
    height: 100%;
    vertical-align: middle;
    box-sizing: border-box;
    word-break: break-word;
    white-space: normal;
    background: #fff;
    overflow-wrap: break-word;
}

.blog-post th:last-child,
.blog-post td:last-child,
.tos-container th:last-child,
.tos-container td:last-child {
    border-right: none;
}

/* Remove double border between rows */
.blog-post tr,
.tos-container tr {
    border-bottom: 1px solid #e5e7eb;
}

.blog-post tr:last-child,
.tos-container tr:last-child {
    border-bottom: none;
}

/* --- Responsive Table Wrapper --- */
.responsive-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Content Alignment --- */
.blog-post p,
.tos-container p {
    text-align: left;
    line-height: 1.6;
}

/* --- Dark Mode Styles --- */
body.dark-mode {
    background-color: #1e1e2e;
    color: #cdd6f4;
}

body.dark-mode .blog-post,
body.dark-mode .tos-container {
    background-color: #313244;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .blog-title,
body.dark-mode .blog-post h1 {
    color: #fff;
    background-color: #45475a;
}

body.dark-mode .meta {
    color: #f5963b;
}

body.dark-mode .tos-title {
    color: #b4befe;
}

body.dark-mode .tos-meta {
    color: #bac2de;
}

body.dark-mode .tos-meta b {
    color: #fff;
}

body.dark-mode .blog-post h2,
body.dark-mode .blog-post h3,
body.dark-mode .tos-container h2,
body.dark-mode .tos-container h3 {
    color: #69b8bf;
    background: none;
}

body.dark-mode .blog-post thead th,
body.dark-mode .tos-container th {
    background: #23263a;
    color: #b4befe;
}

body.dark-mode .blog-post tbody td,
body.dark-mode .tos-container td {
    color: #cdd6f4;
}

/* --- Smooth Transitions --- */
body,
.blog-post,
.tos-container {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* --- Enhanced Mobile Responsive Design --- */

/* Tablet screens (1024px and below) */
@media (max-width: 1024px) {
    .blog-post,
    .tos-container {
        margin: 2rem auto 1.5rem auto;
        padding: 2rem 1.8rem;
    }

    .tos-title {
        font-size: 2.2rem;
    }

    .tos-section-title,
    .tos-subsection-title {
        font-size: 1.25rem;
        margin-top: 1.8em;
    }
}

/* Large mobile screens (768px and below) */
@media (max-width: 768px) {
    .blog-post,
    .tos-container {
        margin: 1.5rem auto 1rem auto;
        padding: 1.5rem 1.2rem;
        border-radius: 12px;
    }

    .tos-title {
        font-size: 1.9rem;
        margin-bottom: 0.8rem;
    }

    .tos-meta {
        font-size: 0.85rem;
        margin-bottom: 1.8rem;
    }

    .tos-section-title,
    .tos-subsection-title {
        font-size: 1.15rem;
        margin-top: 1.5em;
        margin-bottom: 0.8rem;
    }

    /* Enhanced table responsiveness */
    .blog-post table,
    .tos-container table {
        font-size: 0.9rem;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(76, 115, 245, 0.08);
    }

    .blog-post thead th,
    .tos-container th {
        padding: 12px 8px;
        font-size: 0.9rem;
    }

    .blog-post tbody td,
    .tos-container td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
}

/* Medium mobile screens (600px and below) */
@media (max-width: 600px) {
    .blog-post,
    .tos-container {
        margin: 1rem auto 0.5rem auto;
        padding: 1.2rem 1rem;
        border-radius: 8px;
    }

    .tos-title {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }

    .tos-meta {
        font-size: 0.8rem;
        margin-bottom: 1.5rem;
        line-height: 1.6;
    }

    .tos-section-title,
    .tos-subsection-title {
        font-size: 1.1rem;
        margin-top: 1.2em;
        margin-bottom: 0.6rem;
        padding-bottom: 0.3em;
    }

    /* Simple mobile table - container stays within bounds, table scrolls horizontally */
    .blog-post table,
    .tos-container table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 6px;
        font-size: 0.85rem;
        margin-bottom: 1.5em;
        box-shadow: 0 2px 6px rgba(76, 115, 245, 0.1);
        white-space: nowrap;
    }

    .blog-post table thead,
    .blog-post table tbody,
    .tos-container table thead,
    .tos-container table tbody {
        display: table;
        width: 100%;
    }

    .blog-post table tr,
    .tos-container table tr {
        display: table-row;
    }

    .blog-post thead th,
    .tos-container th {
        display: table-cell;
        padding: 10px 6px;
        font-size: 0.8rem;
        min-width: 100px;
        background: #f0f7ff;
        white-space: nowrap;
        vertical-align: middle;
    }

    .blog-post tbody td,
    .tos-container td {
        display: table-cell;
        padding: 8px 6px;
        font-size: 0.75rem;
        min-width: 100px;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.4;
        vertical-align: middle;
    }

    /* Better text spacing on mobile */
    .blog-post p,
    .blog-post ul,
    .blog-post ol,
    .tos-container p,
    .tos-container ul,
    .tos-container ol {
        margin-bottom: 1em;
        line-height: 1.6;
    }

    .blog-post ul,
    .tos-container ul {
        margin-left: 1.2em;
        padding-left: 0;
    }

    .blog-post li,
    .tos-container li {
        margin-bottom: 0.5em;
        line-height: 1.5;
    }
}

/* Small mobile screens (480px and below) */
@media (max-width: 480px) {
    .blog-post,
    .tos-container {
        margin: 0.5rem auto;
        padding: 1rem 0.8rem;
        border-radius: 6px;
    }

    .tos-title {
        font-size: 1.4rem;
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }

    .tos-meta {
        font-size: 0.75rem;
        margin-bottom: 1.2rem;
    }

    .tos-section-title,
    .tos-subsection-title {
        font-size: 1rem;
        margin-top: 1em;
        margin-bottom: 0.5rem;
    }

    /* Ultra-compact table design */
    .blog-post table,
    .tos-container table {
        font-size: 0.7rem;
        border-radius: 4px;
        margin-bottom: 1.2em;
    }

    .blog-post thead th,
    .tos-container th {
        padding: 8px 4px;
        font-size: 0.7rem;
        min-width: 80px;
    }

    .blog-post tbody td,
    .tos-container td {
        padding: 6px 4px;
        font-size: 0.65rem;
        min-width: 80px;
        line-height: 1.3;
    }

    /* Improved text readability */
    .blog-post p,
    .tos-container p {
        font-size: 0.9rem;
        line-height: 1.5;
        text-align: left;
        margin-bottom: 0.8em;
    }

    .blog-post ul,
    .tos-container ul {
        margin-left: 1em;
        font-size: 0.9rem;
    }

    .blog-post li,
    .tos-container li {
        margin-bottom: 0.4em;
        line-height: 1.4;
    }
}

/* Extra small screens (360px and below) */
@media (max-width: 360px) {
    .blog-post,
    .tos-container {
        margin: 0.3rem auto;
        padding: 0.8rem 0.6rem;
    }

    .tos-title {
        font-size: 1.2rem;
        line-height: 1.1;
    }

    .tos-meta {
        font-size: 0.7rem;
    }

    .tos-section-title,
    .tos-subsection-title {
        font-size: 0.95rem;
    }

    /* Minimal table design for very small screens */
    .blog-post table,
    .tos-container table {
        font-size: 0.65rem;
        margin-bottom: 1em;
    }

    .blog-post thead th,
    .tos-container th {
        padding: 6px 3px;
        font-size: 0.65rem;
        min-width: 70px;
    }

    .blog-post tbody td,
    .tos-container td {
        padding: 5px 3px;
        font-size: 0.6rem;
        min-width: 70px;
        line-height: 1.2;
    }
}

/* --- Enhanced Table Wrapper for Better Mobile Experience --- */
.responsive-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1em;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .responsive-table-wrapper {
        border-radius: 6px;
        margin-bottom: 1.2em;
    }
}

/* --- Dark Mode Mobile Adjustments --- */
@media (max-width: 768px) {
    body.dark-mode .blog-post thead th,
    body.dark-mode .tos-container th {
        background: #2a2d3a;
        color: #b4befe;
    }

    body.dark-mode .blog-post tbody td,
    body.dark-mode .tos-container td {
        background: #313244;
        color: #cdd6f4;
    }
}

/* --- Table wrapper for horizontal scroll --- */
.responsive-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Mobile Touch and Interaction Improvements --- */
@media (max-width: 768px) {
    /* Better touch targets */
    .blog-post a,
    .tos-container a {
        padding: 2px 4px;
        margin: -2px -4px;
        border-radius: 4px;
        transition: background-color 0.2s ease;
    }

    .blog-post a:hover,
    .tos-container a:hover {
        background-color: rgba(76, 115, 245, 0.1);
    }

    /* Improved list spacing for mobile */
    .blog-post ul,
    .tos-container ul {
        padding-left: 0;
        margin-left: 1em;
    }

    .blog-post li,
    .tos-container li {
        padding-left: 0.2em;
    }

    /* Better table scroll indicators */
    .blog-post table,
    .tos-container table {
        position: relative;
    }

    .blog-post table::after,
    .tos-container table::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to left, rgba(255,255,255,0.8), transparent);
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .blog-post table:hover::after,
    .tos-container table:hover::after {
        opacity: 1;
    }
}

/* --- Print Styles for Mobile --- */
@media print {
    .blog-post,
    .tos-container {
        margin: 0;
        padding: 1rem;
        box-shadow: none;
        border: none;
        background: white !important;
        color: black !important;
    }

    .blog-post table,
    .tos-container table {
        font-size: 0.8rem;
        border: 1px solid #000;
        page-break-inside: avoid;
    }

    .blog-post thead th,
    .tos-container th {
        background: #f0f0f0 !important;
        color: black !important;
        border: 1px solid #000;
    }

    .blog-post tbody td,
    .tos-container td {
        border: 1px solid #000;
        color: black !important;
    }

    .tos-title {
        color: black !important;
        font-size: 1.5rem;
    }

    .tos-section-title,
    .tos-subsection-title {
        color: black !important;
        font-size: 1.1rem;
        page-break-after: avoid;
    }
}

/* --- Accessibility Improvements --- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .blog-post table,
    .tos-container table {
        border: 2px solid #000;
    }

    .blog-post thead th,
    .tos-container th {
        background: #000;
        color: #fff;
        border: 1px solid #fff;
    }

    .blog-post tbody td,
    .tos-container td {
        border: 1px solid #000;
    }
}

/* --- End of Stylesheet --- */