/* Custom styles for VoicePilot */

/* Prevent zoom issues and ensure proper responsive behavior */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overflow-x: hidden;
}

/* Allow text selection for content areas */
.selectable,
textarea,
input,
p,
h1, h2, h3, h4, h5, h6,
.post-content {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Ensure container doesn't exceed viewport */
.container {
    max-width: 100%;
    box-sizing: border-box;
}

/* Additional responsive fixes */
* {
    box-sizing: border-box;
}

/* Prevent horizontal scroll */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Fix for mobile browsers */
@media screen and (max-width: 768px) {
    body {
        font-size: 16px; /* Prevents iOS zoom on input focus */
    }
    
    input, textarea, select {
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* Smooth transitions */
* {
    transition: all 0.2s ease-in-out;
}

/* Form step transitions */
.form-step {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.form-step.hidden {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

/* Option selection states */
.persona-option input:checked + div,
.content-option input:checked + div,
.tone-option input:checked + div {
    border-color: #2563eb;
    background-color: #eff6ff;
}

.persona-option input:checked + div .bg-primary-100,
.content-option input:checked + div i,
.tone-option input:checked + div i {
    background-color: #2563eb;
    color: white;
}

/* Progress indicator */
.step-label {
    font-weight: 500;
    transition: color 0.3s ease;
}

.step-label.active {
    color: #2563eb;
    font-weight: 600;
}

.step-label.completed {
    color: #059669;
}

/* Button states */
.btn-loading {
    display: flex;
    align-items: center;
}

/* Post cards */
.post-card {
    transition: box-shadow 0.3s ease;
}

.post-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Copy button animation */
.copy-btn:active {
    transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .form-step {
        padding: 0;
    }
    
    .persona-option div,
    .content-option div,
    .tone-option div {
        padding: 1rem;
    }
    
    .flex.justify-between {
        flex-direction: column;
        gap: 1rem;
    }
    
    .flex.justify-between button {
        width: 100%;
        justify-content: center;
    }
}

/* Loading spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Fade in animation for results */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Focus states for accessibility */
.persona-option:focus-within div,
.content-option:focus-within div,
.tone-option:focus-within div {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Textarea enhancements */
textarea:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Error state styling */
.error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

/* Success message styling */
.success-message {
    background-color: #f0fdf4;
    border-color: #22c55e;
    color: #16a34a;
}
