/* Modern CSS for 0Sight - Optimized for Performance */

/* CSS Variables */
:root {
    --white: #ffffff;
    --black: #000000;
    --primary: #dc3545;
    --primary-color: #dc3545;
    --primary-dark: #c82333;
    --secondary: #6c757d;
    --secondary-color: #212529;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --dark: #212529;
    --light: #f8f9fa;
    --light-bg: #f8f9fa;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --transition: all 0.3s ease;
    --border-radius: 0.5rem;
}

/* Prevent scroll jumping on page load */
html {
    scroll-behavior: auto !important;
}

html.loaded {
    scroll-behavior: smooth;
}

/* Calculation state management styles */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn i {
    margin-right: 0.5rem;
}

.btn-warning {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

.alert {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Shake animation for attention */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Input change feedback */
.form-control:focus {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Dirty state indicator for inputs */
.calculation-dirty .form-control:not(:focus) {
    border-color: #0dcaf0;
    transition: border-color 0.3s ease;
}

/* Active editing state when calculation is needed */
.calculation-dirty .form-control:focus {
    border-color: #0dcaf0;
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.25);
}

/* Update button styling */
.calculation-dirty .btn-warning {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: #000;
    animation: subtle-pulse 2s ease-in-out infinite;
}

.calculation-dirty .btn-warning:hover {
    background-color: #31d2f2;
    border-color: #25cff2;
    color: #000;
}

@keyframes subtle-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Result display warning state */
#recalcWarning {
    margin-top: 1rem;
}

/* Smooth transitions for button state changes */
.btn-secondary:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/* ========================================
   1. Layout Components
   ======================================== */

/* Section spacing */
.section {
    padding: 4rem 0;
    position: relative;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #212529 0%, #343a40 100%);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(220, 53, 69, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(220, 53, 69, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-icon {
    margin-bottom: 1rem;
}

/* Animated Crosshair */
.crosshair-container {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    position: relative;
}

.crosshair {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Crosshair Lines */
.crosshair-line {
    position: absolute;
    background-color: #ffffff;
    width: 2px;
    height: 100%;
    top: 50%;
    left: 50%;
    transform-origin: center;
    opacity: 0;
}

.crosshair-line.line1 {
    animation: appearAndRotate1 5s ease-in-out infinite;
}

.crosshair-line.line2 {
    animation: appearAndRotate2 5s ease-in-out infinite;
}

/* Crosshair Circles */
.crosshair-circle {
    position: absolute;
    border: 2px solid #ffffff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.crosshair-circle.outer {
    width: 66px;
    height: 66px;
    animation: circleAppear 5s ease-in-out infinite;
}

.crosshair-circle.middle {
    width: 46px;
    height: 46px;
    animation: circleAppear 5s ease-in-out infinite 0.1s;
}

.crosshair-circle.inner {
    width: 26px;
    height: 26px;
    animation: circleAppear 5s ease-in-out infinite 0.2s;
}

/* Optic Reticle */
.red-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #dc3545;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.8), 
                0 0 40px rgba(220, 53, 69, 0.4),
                inset 0 0 8px rgba(255, 255, 255, 0.3);
    opacity: 0;
    animation: dotAppear 5s ease-in-out infinite;
}

/* Sequential Animations */
@keyframes appearAndRotate1 {
    /* Start: appear as diagonal line / */
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(45deg) scaleY(0);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(45deg) scaleY(1);
    }
    /* Stay as X */
    40% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(45deg) scaleY(1);
    }
    /* Rotate to form + (vertical line) */
    60% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(0deg) scaleY(1);
    }
    /* Stay as + */
    85% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(0deg) scaleY(1);
    }
    /* Fade out */
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(0deg) scaleY(1);
    }
}

@keyframes appearAndRotate2 {
    /* Start: appear as diagonal line \ */
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(-45deg) scaleY(0);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(-45deg) scaleY(1);
    }
    /* Stay as X */
    40% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(-45deg) scaleY(1);
    }
    /* Rotate to form + (horizontal line) */
    60% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(90deg) scaleY(1);
    }
    /* Stay as + */
    85% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(90deg) scaleY(1);
    }
    /* Fade out */
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(90deg) scaleY(1);
    }
}

@keyframes circleAppear {
    0%, 45% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    55% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.1);
    }
    65% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1);
    }
    85% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

@keyframes dotAppear {
    0%, 65% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    75% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3);
        box-shadow: 0 0 30px rgba(220, 53, 69, 1), 
                    0 0 60px rgba(220, 53, 69, 0.6),
                    inset 0 0 12px rgba(255, 255, 255, 0.5);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 20px rgba(220, 53, 69, 0.8), 
                    0 0 40px rgba(220, 53, 69, 0.4),
                    inset 0 0 8px rgba(255, 255, 255, 0.3);
    }
    90% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

.hero-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-description {
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    opacity: 0.9;
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   2. Components
   ======================================== */

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--secondary-color);
}

.btn-success {
    background-color: var(--success-color);
    color: var(--white);
}

.btn-info {
    background-color: var(--info-color);
    color: var(--white);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.form-control {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Section Titles */
.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* ========================================
   3. Calculator Section
   ======================================== */

.calculator-section {
    background-color: var(--light-bg);
}

.calculator-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.calculator-form {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.result-display {
    background: linear-gradient(135deg, #d1ecf1 0%, #c8e5e9 100%);
    border: 2px solid #bee5eb;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.result-display h3 {
    color: #0c5460;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.setup-guide {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.setup-guide h4 {
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.setup-guide ol {
    margin: 0;
    padding-left: 1.25rem;
}

.setup-guide li {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

/* Canvas containers */
.canvas-container {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.canvas-container h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-size: 1.25rem;
}

canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* ========================================
   4. FAQ Section
   ======================================== */

.faq-section {
    background-color: var(--white);
}

.faq-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.faq-category {
    margin-bottom: 1.5rem;
}

.faq-category h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.faq-item {
    background: var(--light-bg);
    border-radius: calc(var(--border-radius) * 0.5);
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid transparent;
}

.faq-item:hover {
    border-color: var(--border-color);
    background: var(--white);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary-color);
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--primary-color);
}

.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    font-size: 0.9rem;
    line-height: 1.5;
}

.faq-item.active .faq-answer {
    padding: 0 1rem 1rem;
    max-height: 500px;
}

/* ========================================
   5. Educational Section
   ======================================== */

.learn-section {
    background-color: var(--light-bg);
}

/* Guide Section Modern Design */
.learn-section {
    background: #f8f9fa;
}

.section-subtitle {
    text-align: center;
    color: #6c757d;
    font-size: 1.125rem;
    margin-bottom: 3rem;
    margin-top: -0.5rem;
}

.guide-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.guide-card {
    background: var(--white);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.guide-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #dc3545 0%, #c82333 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.guide-card:hover::before {
    transform: scaleX(1);
}

.guide-card h3 {
    padding: 1.5rem 2rem 1rem;
    margin: 0;
    color: #212529;
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
}

.guide-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 2rem;
    width: 40px;
    height: 3px;
    background: #dc3545;
    border-radius: 2px;
}

.guide-card > div {
    padding: 0 2rem 2rem;
}

.guide-card p {
    color: #495057;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.guide-card p:last-child {
    margin-bottom: 0;
}

.guide-card strong {
    color: #212529;
    font-weight: 600;
}

.guide-card ul, .guide-card ol {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.guide-card ul li, .guide-card ol li {
    padding-left: 2rem;
    position: relative;
    margin-bottom: 0.75rem;
    color: #495057;
    line-height: 1.6;
    list-style: none;
}

.guide-card ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 6px;
    height: 6px;
    background: #dc3545;
    border-radius: 50%;
}

.guide-card ol {
    counter-reset: guide-counter;
    padding-left: 0;
    list-style: none;
}

.guide-card ol li {
    counter-increment: guide-counter;
    padding-left: 2.5rem;
}

.guide-card ol li::before {
    content: counter(guide-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: #fef3f4;
    color: #dc3545;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   6. Feedback Modal
   ======================================== */

.feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.feedback-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    animation: fadeIn 0.3s ease;
}

.feedback-modal-content {
    position: relative;
    background: var(--white);
    border-radius: calc(var(--border-radius) * 1.5);
    box-shadow: var(--shadow-lg);
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.feedback-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-modal-close:hover {
    color: var(--secondary-color);
}

.feedback-modal-body {
    padding: 2.5rem 2rem 2rem;
    text-align: center;
}

.feedback-modal-title {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.feedback-modal-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Star Rating */
.star-rating {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.star {
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.star:hover {
    color: #ffc107;
    transform: scale(1.1);
}

.star.active {
    color: #ffc107;
}

.star.selected {
    color: #ffc107;
    animation: starPulse 0.3s ease;
}

@keyframes starPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Feedback Form */
.feedback-form {
    margin-top: 1.5rem;
    animation: slideDown 0.3s ease;
}

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

.feedback-comment {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: calc(var(--border-radius) * 0.5);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

.feedback-comment:focus {
    outline: none;
    border-color: var(--primary-color);
}

.feedback-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.feedback-actions .btn {
    flex: 1;
    max-width: 150px;
}

.btn-outline-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

.char-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.cf-turnstile {
    margin-top: 1rem;
}

/* Thank You Message */
.feedback-thank-you {
    padding: 2rem 0;
    animation: fadeIn 0.5s ease;
}

.feedback-thank-you p {
    margin-bottom: 0.5rem;
}

.feedback-thank-you p:first-child {
    font-size: 1.25rem;
    color: var(--success-color);
    font-weight: 500;
}

/* Modal Footer */
.feedback-modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--light-bg);
}

.dont-show-again {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.dont-show-again input[type="checkbox"] {
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   7. Footer
   ======================================== */

.footer {
    background-color: var(--secondary);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.footer a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ========================================
   8. Responsive Design
   ======================================== */


/* Tablet breakpoint */
@media (max-width: 1024px) {
    .faq-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .section {
        padding: 3rem 0;
    }

    .hero-section {
        padding: 2rem 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .guide-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .guide-card h3 {
        font-size: 1.25rem;
        padding: 1.25rem 1.5rem 0.875rem;
    }
    
    .guide-card > div {
        padding: 0 1.5rem 1.5rem;
    }
    
    .guide-card h3::after {
        left: 1.5rem;
    }

    .canvas-container {
        padding: 0.75rem;
    }

    .mobile-legend {
        display: block !important;
        margin-top: 1rem;
        padding: 1rem;
        background: var(--light-bg);
        border-radius: var(--border-radius);
    }

    /* FAQ responsive adjustments */
    .faq-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .faq-category h3 {
        font-size: 1.125rem;
    }

    /* Feedback modal responsive */
    .feedback-modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }

    .feedback-modal-body {
        padding: 2rem 1.5rem 1.5rem;
    }

    .star-rating {
        font-size: 2rem;
    }

    .feedback-modal-title {
        font-size: 1.25rem;
    }
    
    .feedback-modal-subtitle {
        font-size: 0.875rem;
    }
}

/* ========================================
   9. Performance Optimizations
   ======================================== */

/* Use will-change sparingly for elements that will animate */
.btn {
    will-change: transform;
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .hero-section,
    .footer,
    .btn,
    .form-actions {
        display: none;
    }

    .section {
        padding: 1rem 0;
        page-break-inside: avoid;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }
}

/* ========================================
   Field Hints - Modern Tooltip Style
   ======================================== */

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: help;
    position: relative;
    transition: transform 0.2s ease;
}

.field-hint:hover {
    transform: scale(1.1);
}

/* Tooltip */
.field-hint::before {
    content: attr(data-hint);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background-color: var(--dark);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: normal;
    white-space: pre-wrap;
    word-wrap: break-word;
    width: 250px;
    text-align: center;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Tooltip arrow */
.field-hint::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(1px);
    border: 6px solid transparent;
    border-top-color: var(--dark);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.field-hint:hover::before,
.field-hint:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Mobile-friendly adjustments */
@media (max-width: 768px) {
    .field-hint::before {
        white-space: normal;
        max-width: 200px;
        left: auto;
        right: -10px;
        transform: translateY(-8px);
    }
    
    .field-hint::after {
        left: auto;
        right: 4px;
        transform: translateY(1px);
    }
    
    /* Touch-friendly: show hints on tap */
    .field-hint:active::before,
    .field-hint:active::after,
    .field-hint:focus::before,
    .field-hint:focus::after {
        opacity: 1;
        visibility: visible;
    }
}