/* Trial Page - Girly Pink Theme V7 ✨💖 */
/* Solid result title + matching purple boxes */

/* Body - Light pink background */
body {
    background: linear-gradient(135deg, #fff5f9 0%, #ffe6f0 50%, #ffd6e8 100%) !important;
    min-height: 100vh;
    padding: 20px;
}

/* Navigation Bar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    margin: 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo - SOLID COLOR */
.logo h2 {
    margin: 0;
    font-size: 1.5em;
    color: #ff6b9d;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-links li a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    padding: 8px 16px;
    border-radius: 8px;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: #ff6b9d;
    background: rgba(255, 107, 157, 0.1);
}

body:has(.navbar) {
    padding-top: 80px;
}

.trial-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Trial Header - PURPLE */
.trial-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #ff6b9d 0%, #c86dd7 50%, #a855f7 100%);
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(192, 132, 252, 0.25);
    border: 3px solid rgba(255, 255, 255, 0.6);
}

.trial-header h1 {
    font-size: 3em;
    /* Bigger! */
    margin-bottom: 15px;
    color: white;
    font-weight: 800;
    /* Extra bold! */
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.trial-header p {
    font-size: 1.4em;
    /* Bigger! */
    color: white;
    font-weight: 600;
    /* Bold! */
    opacity: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Sample Image Grid */
.sample-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.sample-image-card {
    cursor: pointer;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 3px solid #ffc9e0;
    background: white;
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.15);
}

.sample-image-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(255, 107, 157, 0.3);
    border-color: #ff6b9d;
}

.sample-image-card.selected {
    border-color: #c86dd7;
    box-shadow: 0 0 0 4px rgba(200, 109, 215, 0.3);
    transform: translateY(-5px);
}

.sample-image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.sample-image-card p {
    text-align: center;
    padding: 15px;
    margin: 0;
    background: white;
    font-weight: 600;
    color: #c86dd7;
    font-size: 1.05em;
}

/* Card Styling */
.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 5px 25px rgba(255, 107, 157, 0.12);
    border: 2px solid #ffe6f0;
}

/* Card h2 - Gradient for most headings */
.card h2 {
    background: linear-gradient(135deg, #ff6b9d 0%, #c86dd7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.6em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* EXCEPTION: Result card h2 - SOLID color, no gradient */
#result-card h2 {
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    background-clip: initial !important;
    color: #ff6b9d !important;
    /* Solid pink! */
}

/* Make emojis in headings not transparent */
.card h2 .emoji,
h1 .emoji,
h3 .emoji,
h2 .emoji {
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    background-clip: initial !important;
    color: initial !important;
}

/* Image Preview */
.image-preview {
    text-align: center;
    margin: 20px 0;
    background: linear-gradient(135deg, #f5ebff 0%, #ffe6f0 100%);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e6d4ff;
}

.image-preview img {
    max-width: 100%;
    max-height: 600px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(200, 109, 215, 0.2);
    border: 4px solid white;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #5b21b6;
    font-weight: 600;
    font-size: 0.95em;
}

.form-group select,
.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background: white;
    border: 2px solid #ffc9e0;
    border-radius: 10px;
    color: #2d3748;
    font-size: 0.95em;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group select:focus,
.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b9d;
    background: #fff5f9;
    box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.1);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #a0aec0;
}

/* Checkbox styling */
.form-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #ffa3c1;
    margin-right: 8px;
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 200px;
    height: 8px;
    background: transparent;
    outline: none;
    margin: 0 10px;
    cursor: pointer;
    border-radius: 5px;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #ffe6f0 0%, #ffc9e0 50%, #ff6b9d 100%);
    border: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #ffe6f0 0%, #ffc9e0 50%, #ff6b9d 100%);
    border: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 3px solid #ff6b9d;
    box-shadow: 0 3px 10px rgba(255, 107, 157, 0.3);
    margin-top: -7px;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 3px solid #ff6b9d;
    box-shadow: 0 3px 10px rgba(255, 107, 157, 0.3);
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

/* Special Control Sections */
#emoji-group,
#emoji-feet-group {
    background: linear-gradient(135deg, #f5ebff 0%, #ffe6f0 100%);
    border: 2px solid #e6d4ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(200, 109, 215, 0.1);
}

#emoji-group label,
#emoji-feet-group label {
    color: #5b21b6 !important;
}

#intensity-controls {
    background: linear-gradient(135deg, #fff0f5 0%, #ffe6f0 100%);
    border: 2px solid #ffc9e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.1);
}

#intensity-controls h3 {
    background: linear-gradient(135deg, #ff6b9d 0%, #c86dd7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    font-size: 1.2em;
}

#intensity-controls label {
    color: #5b21b6 !important;
}

#caption-controls {
    background: linear-gradient(135deg, #fff9f5 0%, #ffe6d9 100%);
    border: 2px solid #ffd4b8;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 180, 120, 0.1);
}

#caption-controls h3 {
    background: linear-gradient(135deg, #ff9966 0%, #ff6b9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    font-size: 1.2em;
}

#caption-controls label {
    color: #5b21b6 !important;
}

/* Text Styling Section - PINK (matches Frame Style) */
#text-styling-section,
#text-template-controls,
.text-styling-section,
[id*="text-template"],
[class*="text-styling"] {
    background: linear-gradient(135deg, #fff0f5 0%, #ffe6f0 100%) !important;
    /* Pink like Frame Style! */
    border: 2px solid #ffc9e0 !important;
    border-radius: 12px !important;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.1);
}

#text-styling-section h3,
#text-styling-section .section-title,
#text-template-controls h3,
.text-styling-section h3,
[id*="text-template"] h3,
[class*="text-styling"] h3 {
    color: #ff6b9d !important;
    /* Pink to match Frame Style! */
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: #ff6b9d !important;
    background-clip: initial !important;
    margin-bottom: 15px !important;
    font-size: 1.2em;
}

#text-styling-section label,
#text-template-controls label,
.text-styling-section label,
[id*="text-template"] label,
[class*="text-styling"] label {
    color: #5b21b6 !important;
}

#border-controls {
    background: linear-gradient(135deg, #fff0f5 0%, #ffe6f0 100%) !important;
    border: 2px solid #ffc9e0 !important;
    border-radius: 12px !important;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.1);
}

#border-controls h3 {
    color: #ff6b9d !important;
    /* Solid pink - override inline style! */
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: #ff6b9d !important;
    background-clip: initial !important;
    margin-bottom: 15px !important;
    font-size: 1.2em;
}

#border-controls label {
    color: #5b21b6 !important;
}

/* Frame Style Section - CONSISTENT with border controls */
#frame-style-section,
.frame-style-section,
[id*="frame"],
[class*="frame-style"] {
    background: linear-gradient(135deg, #fff0f5 0%, #ffe6f0 100%) !important;
    border: 2px solid #ffc9e0 !important;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.1);
}

#frame-style-section h3,
#frame-style-section .section-title,
.frame-style-section h3,
[id*="frame"] h3,
[class*="frame-style"] h3 {
    color: #ff6b9d !important;
    /* Solid pink! */
    background: none !important;
    /* No gradient! */
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: #ff6b9d !important;
    background-clip: initial !important;
    margin-bottom: 15px;
    font-size: 1.2em;
}

#frame-style-section label,
.frame-style-section label,
[id*="frame"] label,
[class*="frame-style"] label {
    color: #5b21b6 !important;
}

/* Buttons */
.btn {
    padding: 14px 30px;
    border-radius: 25px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1em;
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-success {
    background: linear-gradient(135deg, #ff6b9d 0%, #c86dd7 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.35);
}

.btn-primary {
    background: linear-gradient(135deg, #c86dd7 0%, #a855f7 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(200, 109, 215, 0.35);
}

.btn-secondary {
    background: linear-gradient(135deg, #ff6b9d 0%, #c86dd7 100%);
    color: white;
    border: none;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.35);
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.1em;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* CTA Card - PINK GRADIENT (same as hero) */
.cta-card {
    text-align: center;
    background: linear-gradient(135deg, #ff6b9d 0%, #c86dd7 50%, #a855f7 100%);
    /* Same pink gradient as hero! */
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.6);
}

.cta-card h2 {
    color: white !important;
    /* Force white! */
    background: none !important;
    /* No gradient! */
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: white !important;
    background-clip: initial !important;
    font-size: 2em;
    /* Bigger! */
    font-weight: 800;
    /* Extra bold! */
    margin-bottom: 20px;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.cta-card p {
    opacity: 1;
    margin-bottom: 30px;
    font-size: 1.3em;
    /* Bigger! */
    color: white;
    font-weight: 600;
    /* Bold! */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cta-card .btn {
    background: white;
    color: #9333ea;
    /* Purple text */
    font-weight: 700;
    border: none;
}

.cta-card .btn:hover {
    background: #faf5ff;
    transform: translateY(-3px) scale(1.05);
}

/* Emoji Preview Tooltip */
.emoji-preview-tooltip {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    background: white;
    border: 4px solid #ff6b9d;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 15px 40px rgba(255, 107, 157, 0.3);
    display: none;
}

.emoji-preview-tooltip img {
    width: 250px;
    height: 250px;
    object-fit: contain;
    display: block;
    border-radius: 10px;
}

.emoji-preview-tooltip p {
    margin: 10px 0 0 0;
    text-align: center;
    font-weight: 600;
    color: #ff6b9d;
    font-size: 14px;
}

.emoji-preview-tooltip.show {
    display: block !important;
    animation: emojiPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes emojiPop {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Loading Indicator */
#loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(255, 107, 157, 0.12);
    border: 2px solid #ffe6f0;
}

#loading p {
    background: linear-gradient(135deg, #ff6b9d 0%, #c86dd7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    font-size: 1.1em;
    margin-top: 20px;
}

.spinner {
    border: 4px solid #ffe6f0;
    border-top: 4px solid #ff6b9d;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sample-images-grid {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .nav-links {
        gap: 15px;
        font-size: 0.9em;
    }
}


/* ═══════════════════════════════════════════════════════════
   ADVANCED LIVE PREVIEW PANEL
   ═══════════════════════════════════════════════════════════ */

.advanced-preview-panel {
    position: fixed;
    right: 20px;
    top: 100px;
    width: 500px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.preview-header {
    background: linear-gradient(135deg, #ff6b9d 0%, #c86dd7 50%, #a855f7 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.preview-header h3 {
    margin: 0;
    font-size: 18px;
}

.preview-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.preview-modes {
    display: flex;
    background: #f0f0f0;
    padding: 10px;
    gap: 5px;
}

.preview-mode-btn {
    flex: 1;
    padding: 8px 12px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.preview-mode-btn:hover {
    border-color: #a855f7;
    color: #a855f7;
}

.preview-mode-btn.active {
    background: linear-gradient(135deg, #ff6b9d 0%, #c86dd7 50%, #a855f7 100%);
    color: white;
    border-color: #a855f7;
}

.preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 15px;
}

.preview-image-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

#advanced-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.preview-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preview-settings {
    background: #f0f0f0;
    padding: 10px;
    border-radius: 8px;
}

.preview-settings h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #666;
}

.preview-settings p {
    margin: 0;
    font-size: 13px;
    color: #333;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    background: transparent;
}

.resize-n, .resize-s {
    left: 0;
    right: 0;
    height: 10px;
    cursor: ns-resize;
}

.resize-e, .resize-w {
    top: 0;
    bottom: 0;
    width: 10px;
    cursor: ew-resize;
}

.resize-n { top: 0; }
.resize-s { bottom: 0; }
.resize-e { right: 0; }
.resize-w { left: 0; }

.resize-ne, .resize-nw, .resize-se, .resize-sw {
    width: 15px;
    height: 15px;
}

.resize-ne {
    top: 0;
    right: 0;
    cursor: nesw-resize;
}

.resize-nw {
    top: 0;
    left: 0;
    cursor: nwse-resize;
}

.resize-se {
    bottom: 0;
    right: 0;
    cursor: nwse-resize;
}

.resize-sw {
    bottom: 0;
    left: 0;
    cursor: nesw-resize;
}

/* ==========================================
   📱 MOBILE RESPONSIVE STYLES
   ========================================== */

/* Tablet and below (768px) */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    /* Header */
    .trial-header h1 {
        font-size: 2em;
    }
    
    .trial-header p {
        font-size: 1.1em;
    }
    
    /* Sample images grid - 2 columns on mobile */
    .sample-images-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .sample-image-card {
        padding: 12px;
    }
    
    .sample-image-card img {
        height: 120px;
    }
    
    .sample-image-card p {
        font-size: 0.85em;
    }
    
    /* Cards */
    .card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .card h2 {
        font-size: 1.3em;
    }
    
    /* Options form - Stack vertically */
    .options-form {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.95em;
    }
    
    .form-group select,
    .form-group input[type="text"],
    .form-group input[type="number"] {
        font-size: 16px; /* Prevent iOS zoom */
        padding: 12px;
    }
    
    /* Buttons - Touch-friendly */
    .btn,
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        padding: 14px 24px;
        font-size: 1em;
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Preview images - Full width */
    #original-preview,
    #result-preview {
        max-width: 100%;
        width: 100%;
        height: auto;
    }
    
    /* Range sliders - Full width */
    input[type="range"] {
        width: 100%;
    }
    
    /* Color boxes - Smaller on mobile */
    .color-box {
        width: 35px;
        height: 35px;
        min-width: 35px;
        min-height: 35px;
    }
    
    /* Emoji selector - Smaller grid */
    .emoji-selector {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .emoji-option {
        width: 50px;
        height: 50px;
    }
    
    .emoji-option img {
        width: 35px;
        height: 35px;
    }
    
    /* Advanced preview - Full screen */
    .advanced-preview-panel {
        right: 0 !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
    }
    
    .preview-image-container {
        height: calc(100vh - 180px);
    }
    
    /* Template controls */
    .template-controls {
        padding: 15px;
    }
    
    .template-list {
        gap: 8px;
    }
    
    .template-item {
        padding: 10px 12px;
        flex-direction: column;
        gap: 8px;
    }
    
    .template-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Text caption controls */
    .caption-controls,
    .text-template-controls {
        padding: 15px;
    }
    
    /* Border controls */
    #border-controls {
        padding: 15px;
    }
}

/* Small mobile (480px) */
@media (max-width: 480px) {
    .trial-header h1 {
        font-size: 1.6em;
    }
    
    .trial-header p {
        font-size: 1em;
    }
    
    /* Sample images - Stack vertically */
    .sample-images-grid {
        grid-template-columns: 1fr;
    }
    
    .sample-image-card img {
        height: 150px;
    }
    
    /* Cards */
    .card {
        padding: 15px;
    }
    
    .card h2 {
        font-size: 1.2em;
    }
    
    /* Buttons */
    .btn,
    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 0.95em;
    }
    
    /* Emoji grid - 3 columns */
    .emoji-selector {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Landscape mobile - Optimize for viewing */
@media (max-width: 896px) and (orientation: landscape) {
    .trial-header {
        padding: 20px;
    }
    
    .trial-header h1 {
        font-size: 1.5em;
    }
    
    .trial-header p {
        font-size: 1em;
    }
    
    /* Sample grid - horizontal on landscape */
    .sample-images-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .sample-image-card img {
        height: 100px;
    }
}

/* Touch-specific improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for all interactive elements */
    .sample-image-card {
        min-height: 48px;
        cursor: pointer;
    }
    
    .color-box,
    .emoji-option {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Prevent text selection during interaction */
    .sample-images-grid,
    .emoji-selector,
    .color-boxes {
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
    
    /* Better spacing for touch */
    .options-form {
        gap: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}




/* MOBILE BUTTON ALIGNMENT FIXES */
/* Add this to the END of existing CSS files - won't affect desktop! */

/* ========================================
   MOBILE-ONLY FIXES (max-width: 768px)
   Desktop is completely unaffected
   ======================================== */

@media (max-width: 768px) {
    
    /* FIX 1: Center all buttons on mobile */
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-large,
    button[type="submit"] {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
    }
    
    /* FIX 2: Hero/CTA buttons container - center alignment */
    .hero-buttons,
    .cta-buttons,
    .demo-actions {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 15px !important;
    }
    
    /* FIX 3: Individual CTA buttons */
    .hero-buttons .btn,
    .cta-buttons .btn,
    .demo-actions .btn {
        width: 90% !important;
        max-width: 400px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* FIX 4: Form buttons - center text */
    .form-actions,
    .button-group,
    .action-buttons {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
    }
    
    .form-actions .btn,
    .button-group .btn,
    .action-buttons .btn {
        width: 90% !important;
        max-width: 400px !important;
    }
    
    /* FIX 5: Trial page - Apply & Preview buttons */
    #apply-btn,
    #preview-btn,
    button[onclick*="apply"],
    button[onclick*="preview"] {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 90% !important;
        max-width: 400px !important;
    }
    
    /* FIX 6: Section containers - center content */
    section,
    .section,
    .card {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    /* FIX 7: Purple CTA sections */
    .cta-section,
    section[style*="background"],
    .hero-section {
        text-align: center !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .cta-section .btn,
    section[style*="background"] .btn {
        display: block !important;
        margin: 10px auto !important;
        width: 90% !important;
        max-width: 400px !important;
    }
    
    /* FIX 8: Ask Questions page - form buttons */
    .question-form .btn,
    #questionForm .btn,
    form .btn-primary {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* PRECISE BUTTON CENTER FIX - Mobile Only */
/* Add to end of CSS files or create as separate file */

@media (max-width: 768px) {
    /* FIX: ngrok warning page buttons */
    .hero-buttons,
    .cta-buttons {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 0 20px !important;
    }
    
    .hero-buttons a,
    .cta-buttons a,
    .hero-buttons .btn,
    .cta-buttons .btn {
        width: 100% !important;
        max-width: 500px !important;
        display: block !important;
        margin: 0 auto 15px auto !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    
    /* FIX: Demos page buttons */
    .demo-actions {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 0 20px !important;
    }
    
    .demo-actions .btn {
        width: 100% !important;
        max-width: 500px !important;
        margin: 0 auto 15px auto !important;
        text-align: center !important;
    }
    
    /* FIX: Trial page buttons */
    #apply-btn,
    #preview-btn,
    button[id*="apply"],
    button[id*="preview"],
    .trial-actions button,
    .trial-actions .btn {
        width: 100% !important;
        max-width: 600px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
        text-align: center !important;
    }
    
    /* FIX: All button containers */
    .button-group,
    .action-buttons,
    .form-actions {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    /* FIX: Ensure button text is centered */
    .btn,
    .btn-primary,
    .btn-secondary,
    button {
        text-align: center !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}
/* ========================================
   END MOBILE-ONLY FIXES
   Desktop unaffected ✅
   ======================================== */
