/* PrivacyPolicyGen - Custom Styles */

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
}

/* Custom scrollbar for preview */
#policyPreview::-webkit-scrollbar {
    width: 8px;
}

#policyPreview::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#policyPreview::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#policyPreview::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Form step transitions */
.form-step {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Checkbox styling */
input[type="checkbox"]:checked {
    background-color: #1e40af;
    border-color: #1e40af;
}

input[type="radio"]:checked {
    border-color: #1e40af;
}

/* Focus states */
input:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.2);
}

/* ==========================================
   Accessibility Enhancements
   ========================================== */

/* Focus-visible styles for keyboard navigation */
:focus-visible {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Screen reader only utility class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High contrast focus for form elements */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #1e40af;
    outline-offset: 1px;
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.15);
}

/* Checkbox and radio focus-visible */
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
}

/* Label focus for keyboard navigation */
label[tabindex="0"]:focus-visible {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
    border-radius: 8px;
}

/* FAQ button focus */
.faq-toggle:focus-visible {
    outline: 2px solid #1e40af;
    outline-offset: -2px;
    border-radius: 8px;
}

/* Navigation link focus */
nav a:focus-visible {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced motion support for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .form-step {
        animation: none;
    }

    .faq-content {
        transition: none;
    }

    #progressBar {
        transition: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    button {
        border: 2px solid currentColor;
    }

    input,
    select,
    textarea {
        border: 2px solid #000;
    }

    .faq-toggle {
        border: 2px solid #000;
    }

    a {
        text-decoration: underline;
    }
}

/* Button hover effects */
button {
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.98);
}

/* FAQ accordion animation */
.faq-toggle svg {
    transition: transform 0.3s ease;
}

.faq-toggle.active svg {
    transform: rotate(180deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-content.show {
    max-height: 500px;
}

/* Policy preview styles */
#policyPreview h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

#policyPreview h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

#policyPreview h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

#policyPreview p {
    color: #4b5563;
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

#policyPreview ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

#policyPreview li {
    color: #4b5563;
    margin-bottom: 0.25rem;
}

#policyPreview strong {
    color: #1f2937;
}

/* Toast notification */
#toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #policyPreview {
        height: 400px;
        -webkit-overflow-scrolling: touch;
    }

    .grid-cols-2 {
        grid-template-columns: 1fr;
    }

    /* Larger touch targets for mobile buttons */
    #prevBtn,
    #nextBtn,
    #generateBtn {
        min-height: 48px;
        padding: 14px 24px;
        font-size: 16px;
    }

    /* Better touch targets for checkboxes and radio labels */
    label:has(input[type="checkbox"]),
    label:has(input[type="radio"]) {
        min-height: 48px;
        padding: 14px 12px;
    }

    /* Larger copy/download buttons on mobile */
    #policyPreview + .flex button,
    .flex.space-x-2 button {
        min-height: 44px;
        padding: 10px 16px;
    }

    /* Improve form input touch targets */
    input[type="text"],
    input[type="email"],
    input[type="url"],
    select {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Step progress visibility improvement */
    #progressBar {
        height: 6px;
    }

    /* Toast notification positioning for mobile */
    #toast {
        left: 16px;
        right: 16px;
        bottom: 80px;
        text-align: center;
    }

    /* Navigation button container layout for mobile */
    .flex.justify-between.mt-8 {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .flex.justify-between.mt-8 button {
        width: 100%;
        margin-left: 0 !important;
    }

    /* Third-party services grid single column on mobile */
    #step4 .grid.grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Small mobile devices */
@media (max-width: 375px) {
    #policyPreview {
        height: 350px;
        padding: 16px;
    }

    #policyPreview h1 {
        font-size: 1.25rem;
    }

    #policyPreview h2 {
        font-size: 1.1rem;
    }

    #policyPreview p,
    #policyPreview li {
        font-size: 0.875rem;
    }
}

/* Loading spinner */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Highlight effect for copy feedback */
.highlight-flash {
    animation: flash 0.5s ease;
}

@keyframes flash {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(30, 64, 175, 0.1);
    }
}

/* Mobile menu animation */
#mobileMenu {
    transition: max-height 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

#mobileMenu.show {
    max-height: 300px;
}

/* Gradient text for headings (optional enhancement) */
.gradient-text {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card hover effects */
.feature-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Input label animations */
.input-group label {
    transition: color 0.2s ease;
}

.input-group:focus-within label {
    color: #1e40af;
}

/* Pricing card hover */
.pricing-card {
    transition: transform 0.2s ease;
}

.pricing-card:hover {
    transform: scale(1.02);
}

/* Checkbox container hover */
label:has(input[type="checkbox"]):hover,
label:has(input[type="radio"]):hover {
    border-color: #1e40af;
    background-color: #f0f9ff;
}

/* Progress bar animation */
#progressBar {
    transition: width 0.5s ease;
}

/* ==========================================
   Premium Step Indicator Styles
   ========================================== */

/* Step indicator base styling */
.step-indicator {
    flex: 0 0 auto;
}

.step-circle {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Completed step styling */
.step-circle.completed {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.step-circle.completed .step-number {
    display: none;
}

.step-circle.completed .step-check {
    display: block !important;
}

/* Active step styling */
.step-circle.active {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.4);
    transform: scale(1.1);
}

/* Shimmer effect for progress bar */
.progress-bar-shimmer {
    position: relative;
    overflow: hidden;
}

.progress-bar-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Premium Policy Preview Styles */
.policy-preview {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    position: relative;
}

.policy-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af, #3b82f6, #1e40af);
    border-radius: 12px 12px 0 0;
}

#policyPreview h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

#policyPreview h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1e40af;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

#policyPreview h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

#policyPreview p {
    color: #4b5563;
    margin-bottom: 1rem;
    line-height: 1.75;
}

#policyPreview ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 1rem;
}

#policyPreview li {
    color: #4b5563;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

#policyPreview li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 6px;
    height: 6px;
    background: #1e40af;
    border-radius: 50%;
}

#policyPreview strong {
    color: #1f2937;
    font-weight: 600;
}

#policyPreview a {
    color: #1e40af;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#policyPreview a:hover {
    color: #3b82f6;
}

/* Premium checkbox styling */
label:has(input[type="checkbox"]),
label:has(input[type="radio"]) {
    transition: all 0.2s ease;
    border-color: #e5e7eb;
}

label:has(input[type="checkbox"]:checked),
label:has(input[type="radio"]:checked) {
    border-color: #1e40af !important;
    background-color: #eff6ff !important;
    box-shadow: 0 0 0 1px #1e40af inset;
}

/* Form input styling enhancements */
input[type="text"],
input[type="email"],
input[type="url"],
select {
    transition: all 0.2s ease;
    background-color: #fff;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="url"]:hover,
select:hover {
    border-color: #9ca3af;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
select:focus {
    border-color: #1e40af;
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

/* Toast notification enhancement */
#toast {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-left: 4px solid #1e40af;
}

#toast.show {
    animation: slideInToast 0.4s ease-out;
}

@keyframes slideInToast {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Section divider */
.section-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #1e40af, #3b82f6);
    border-radius: 2px;
    margin: 0 auto 2rem;
}

/* Success celebration animation for toast */
#toast.success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

/* Pulse animation for generate button when ready */
#generateBtn:not(.hidden) {
    animation: gentlePulse 2s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
}

/* Celebration bounce for completed progress bar */
#progressBar[style*="100%"] {
    animation: celebrateBounce 0.5s ease-out;
}

@keyframes celebrateBounce {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.3); }
}

/* Encouraging progress indicator styling */
#progressPercent {
    transition: color 0.3s ease;
}

/* Fun hover effect on action buttons */
button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0) scale(0.98);
}

/* Print styles for downloaded policies */
@media print {
    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    h1 {
        font-size: 18pt;
    }

    h2 {
        font-size: 14pt;
    }

    nav, footer, .no-print {
        display: none !important;
    }
}

/* ==========================================
   Organic Growth Sections
   ========================================== */

/* Viral footer in generated policies */
#policyPreview hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

#policyPreview a[href*="privacypolicygen.io"] {
    color: #1e40af;
    text-decoration: underline;
    font-weight: 500;
}

/* Industry examples cards */
#examples .bg-white {
    transition: all 0.3s ease;
}

#examples .bg-white:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Privacy law cards */
#privacy-laws .bg-gradient-to-br {
    transition: all 0.3s ease;
}

#privacy-laws .bg-gradient-to-br:hover {
    transform: translateY(-4px);
}

/* Startup section backdrop blur fallback */
@supports not (backdrop-filter: blur(10px)) {
    #startups .bg-white\/5 {
        background-color: rgba(31, 41, 55, 0.9);
    }
}

/* Community share buttons */
#startups button {
    transition: all 0.2s ease;
}

#startups button:hover {
    transform: translateY(-2px);
}

/* Free tools cards */
#free-tools .bg-gradient-to-br {
    transition: all 0.3s ease;
}

#free-tools .bg-gradient-to-br:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

/* Newsletter section */
#newsletter .bg-white {
    transition: box-shadow 0.3s ease;
}

#newsletter .bg-white:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Email capture modal */
#emailCaptureModal,
#badgeModal {
    backdrop-filter: blur(4px);
}

#emailCaptureContent,
#badgeModalContent {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Extended FAQ sections */
#extended-faq .bg-white {
    transition: all 0.2s ease;
}

#extended-faq .bg-white:hover {
    border-color: #1e40af;
}

/* Lawyer/white-label section */
#lawyers .bg-white {
    transition: all 0.3s ease;
}

#lawyers .bg-white:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Partner benefit cards */
#lawyers .bg-gray-50 {
    transition: all 0.2s ease;
}

#lawyers .bg-gray-50:hover {
    background-color: #f0f9ff;
}

/* Primary light color for dark sections */
.text-primary-light {
    color: #60a5fa;
}

/* Badge preview hover */
#badgeModal .bg-gray-50:hover {
    background-color: #f0f9ff;
}

/* Responsive adjustments for new sections */
@media (max-width: 768px) {
    #startups .grid {
        gap: 2rem;
    }

    #newsletter .grid {
        gap: 1.5rem;
    }

    #lawyers .grid {
        gap: 2rem;
    }

    #extended-faq .space-y-4 > div {
        margin-bottom: 0.5rem;
    }

    /* Stack community share buttons */
    #startups .bg-white\/10 {
        margin-bottom: 0.75rem;
    }
}

/* SEO-optimized FAQ visual hierarchy */
#extended-faq h3 {
    position: sticky;
    top: 0;
    background: linear-gradient(to bottom, #f9fafb 0%, #f9fafb 90%, transparent 100%);
    padding-top: 1rem;
    padding-bottom: 0.5rem;
    z-index: 10;
}

@media (max-width: 640px) {
    #extended-faq h3 {
        position: static;
        background: none;
    }
}
