@import "../api/style.css";

/* ============================================================
   QR Maker Documentation Utilities
   ============================================================ 
   
   1. COLUMN SPLITS (.col-split)
      Used to create multi-column split sections. They automatically
      collapse into a single column on screens smaller than 768px.
      
      Available column ratios:
      - .col-50-50 : Equal 50% split (1fr 1fr)
      - .col-60-40 : 60% text content / 40% media visual (3fr 2fr)
      - .col-40-60 : 40% text content / 60% media visual (2fr 3fr)
      - .col-70-30 : 70% text content / 30% media visual (7fr 3fr)
      - .col-30-70 : 30% text content / 70% media visual (3fr 7fr)
      - .col-75-25 : 75% text content / 25% media visual (3fr 1fr)
      - .col-25-75 : 25% text content / 75% media visual (1fr 3fr)

   2. CARDS MODULES (.help-feature-grid / .help-feature-card)
      Original card grids to show features side-by-side. 
      Responsive layout adjusts columns based on available space.
   ============================================================ */

/* --- Flexible Grid Columns --- */
.col-split {
    display: grid;
    gap: 2rem;
    align-items: start;
    margin: 1.5rem 0;
}

/* Ratios */
.col-50-50 {
    grid-template-columns: 1fr 1fr;
}

.col-60-40 {
    grid-template-columns: 3fr 2fr;
}

.col-40-60 {
    grid-template-columns: 2fr 3fr;
}

.col-70-30 {
    grid-template-columns: 7fr 3fr;
}

.col-30-70 {
    grid-template-columns: 3fr 7fr;
}

.col-75-25 {
    grid-template-columns: 3fr 1fr;
}

.col-25-75 {
    grid-template-columns: 1fr 3fr;
}

@media (min-width: 1025px) {
    .page-content {
        padding: 0 !important;
    }
}

/* Bullet list style inside docs */
.help-list {
    padding-left: 1.25rem;
    margin: 1rem 0;
}

.help-list li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.help-list li strong {
    color: var(--text-main);
}

/* Custom list style with icon circles inside docs */
.help-list-custom {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0;
}

.help-list-custom li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.help-list-custom .list-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background-color: var(--accent);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-top: 0.15rem;
}

.help-list-custom .list-icon svg {
    width: 18px;
    height: 18px;
}

.help-list-custom .list-text strong {
    color: var(--text-main);
}

/* Responsive adjustment for columns */
@media (max-width: 768px) {
    .col-split {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
}

/* --- Help Feature Grid --- */
.help-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.help-feature-card {
    background-color: var(--control-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.help-feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color-strong);
}

.help-feature-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-family: var(--font-title);
    color: var(--text-main);
}

.help-feature-card p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    color: var(--text-subtle);
}

/* --- Instructive Media Containers --- */
.media-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(27, 82, 86, 0.05) 0%, rgba(39, 132, 51, 0.03) 100%);
    border: 2px dashed rgba(39, 132, 51, 0.25);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    margin: 2rem 0;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
}

.media-container.has-image {
    padding: 0;
    border: 1px solid var(--border-color);
    background: none;
}

.media-container.has-video {
    padding: 0;
    border: none;
    background: none;
}

.media-container.has-image .media-icon,
.media-container.has-image .media-title,
.media-container.has-image .media-description,
.media-container.has-video .media-icon,
.media-container.has-video .media-title,
.media-container.has-video .media-description {
    display: none;
}

.media-container picture {
    display: block;
    width: 100%;
}

.media-container video {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 500px;
    margin: 0 auto;
    border-radius: var(--radius-md);
}

.media-container img {
    display: block;
    width: 100%;
    height: auto;
}

.media-container:not(.has-image) picture {
    display: none;
}

.media-container:not(.has-video) video {
    display: none;
}

[data-theme="light"] .media-container:not(.has-image):not(.has-video) {
    background: linear-gradient(135deg, rgba(27, 82, 86, 0.04) 0%, rgba(39, 132, 51, 0.02) 100%);
    border: 2px dashed rgba(27, 82, 86, 0.18);
}

.media-icon {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    user-select: none;
}

.media-title {
    font-family: var(--font-title);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-main);
}

.media-description {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-subtle);
    max-width: 480px;
    margin: 0 auto;
}

/* --- Info Aside (Cheeky Callout) --- */
.info-aside {
    background-color: rgba(39, 132, 51, 0.08);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
}

[data-theme="light"] .info-aside {
    background-color: rgba(27, 82, 86, 0.06);
}

.aside-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-readable);
    margin-bottom: 0.5rem;
    font-family: var(--font-title);
}

.info-aside p {
    font-size: 0.925rem;
    line-height: 1.55;
    margin: 0;
    color: var(--text-muted);
}

/* --- Lightbox Modal --- */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-modal.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox-modal.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #fff;
    font-size: 40px;
    font-weight: 300;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    padding: 10px;
    z-index: 1010;
}

.lightbox-close:hover {
    color: var(--accent-readable);
}

.lightbox-caption {
    margin-top: 1.5rem;
    color: #ccc;
    font-size: 0.95rem;
    text-align: center;
    max-width: 600px;
    line-height: 1.5;
    font-family: var(--font-sans);
    padding: 0 1rem;
}

/* --- Media Figure & Caption Styling --- */
.media-figure {
    margin: 2rem 0;
    display: block;
}

.col-media .media-figure {
    margin: 0;
}

.media-caption {
    margin-top: 0.75rem;
    font-size: 0.825rem;
    color: var(--text-subtle);
    line-height: 1.4;
    text-align: center;
}

/* Constrain video area height to match content height on non-mobile screens */
@media (min-width: 769px) {
    .col-split:has(.media-container.has-video) {
        align-items: stretch;
    }

    .col-split:has(.media-container.has-video) .col-media {
        display: flex;
        flex-direction: column;
    }

    .col-split:has(.media-container.has-video) .media-figure {
        flex: 1;
        display: flex;
        flex-direction: column;
        margin: 0;
        height: 100%;
    }

    .col-split:has(.media-container.has-video) .media-container {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 0;
        /* Allow the container to shrink to fit the parent height */
    }

    .col-split:has(.media-container.has-video) video {
        max-height: 100%;
        height: auto;
        width: auto;
        max-width: 100%;
    }
}

/* --- Shortcuts Module & Badge Styles (copied from home.css) --- */
.apple-shortcuts-badge {
    display: inline-flex;
    align-items: center;
    background: #000000;
    color: #ffffff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 11px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1.5px solid rgba(255, 255, 255, 0.288);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.apple-shortcuts-badge:hover {
    background: #0a0a0a;
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.apple-shortcuts-badge:active {
    transform: scale(0.97);
}

.apple-shortcuts-logo {
    margin-right: 14px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.958);
}

/* --- Theme-Aware Display Utilities --- */
.light-only {
    display: none !important;
}

.dark-only {
    display: block !important;
}

.badge-text-wrapper {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.badge-label {
    color: #ffffff;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    line-height: 12px;
    opacity: 0.9;
}

.badge-title {
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    font-family: -apple-system, system-ui, sans-serif;
    line-height: 20px;
    margin-top: 1px;
}

.shortcuts-widget-aside {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.native-shortcuts-card {
    width: 250px;
    height: 180px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border-radius: 32px;
    padding: 22px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 10px 24px rgba(39, 174, 96, 0.15);
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.native-shortcuts-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 14px 24px rgba(39, 174, 96, 0.28);
}

.shortcuts-widget-aside a,
.shortcuts-widget-aside a:hover {
    text-decoration: none !important;
}

.native-shortcuts-card,
.widget-app-title {
    text-decoration: none !important;
}

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.widget-qr-icon {
    width: 36px;
    height: 36px;
    opacity: 0.95;
}

.widget-play-orb {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-play-orb svg {
    width: 14px;
    height: 14px;
    margin-left: 2px;
}

.widget-app-title {
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.4px;
    margin-bottom: 2px;
}

/* Fullwidth Video styling */
.media-container.fullwidth-video {
    width: 100%;
    max-width: 100%;
}

.media-container.fullwidth-video video {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
}

/* Shortcuts Demo Video Figure responsive styling */
.shortcuts-demo-video-figure {
    margin: 2rem 4rem;
}

@media (max-width: 768px) {
    .shortcuts-demo-video-figure {
        margin: 2rem 0;
    }
}

/* --- Inline Table of Contents --- */
.inline-toc {
    margin: 3rem 0;
    padding: 0;
}

.toc-title {
    font-family: var(--font-title);
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1.25rem;
    color: var(--text-main);
    letter-spacing: normal;
    text-transform: none;
}

.toc-list {
    list-style: none !important;
    list-style-type: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toc-list li {
    list-style: none !important;
    list-style-type: none !important;
    font-size: 1.1rem;
    position: relative;
    padding-left: 1.5rem;
    line-height: 1.4;
}

.toc-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
    font-size: 1.4rem;
    line-height: 1;
    top: 0.1rem;
}

.toc-list a {
    color: var(--accent-readable);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.toc-list a:hover {
    color: var(--accent);
    text-decoration: underline;
}