/* =============================================================================
   Page: sub_pages/swift-swiftui-cheatsheet.html
   Styling for the small SwiftUI "what you would see" demos rendered next to
   each snippet. These widgets exist nowhere else on the site.
   ========================================================================== */

.card h3 {
    font-size: 1.25rem;
}

/* Denser subsection rule than the guides use: this page has many of them. */
.subsection-title {
    font-size: 1.5rem;
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
}

/* --- Demo widgets inside .output-box -------------------------------------- */

/* Stand-in for SwiftUI's indeterminate ProgressView. */
.output-box .spinner-border {
    width: 32px;
    height: 32px;
    border: 3px solid var(--output-border-color);
    border-top-color: #007AFF;
    border-radius: 50%;
    animation: spinner-rotate 0.9s linear infinite;
}

@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}

.output-box .styled-text,
.output-box .interactive-button {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 1rem;
    padding: 8px 12px;
    border: 0;
    border-radius: var(--radius-lg);
    color: #ffffff;
    background-color: #007AFF;
}

/* Rendered as a real <button> so the demo is keyboard operable. */
.output-box .interactive-button {
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast);
}

.output-box .interactive-button:hover {
    background-color: #0056b3;
}

.output-box .image-placeholder {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    background-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 0.8rem;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.output-box .gradient-bg {
    width: 100%;
    height: 80px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: bold;
}

.output-box .nav-bar {
    width: 100%;
    padding: var(--space-2);
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    text-align: center;
    color: var(--heading-color);
}

@media (prefers-color-scheme: dark) {
    .output-box .nav-bar {
        background-color: #3a3a3c;
        border-bottom: 1px solid #555;
    }
}
