/* Common styles shared between desktop and mobile versions */

/* Screen reader only - visually hidden but accessible to assistive technologies */
.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;
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #ffffff;
    min-height: 100vh;
}

/* Utility: hide on desktop by default, show on mobile via mobile.css */
.mobile-only {
    display: none;
}

/* Top bar (full-width at top) */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 1000;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between; /* space between logo and nav */
    padding: 17px 16px; /* increased by 30% from 13px 12px */
    position: relative; /* anchor left brand absolutely within */
}

.topbar .topbar-brand {
    position: absolute;
    left: 16px;
    text-decoration: none;
    color: inherit;
    font-size: 55px; /* increased by 30% from 42px */
    font-weight: 600;
    flex-shrink: 0;
    z-index: 1;
}

/* Topbar navigation */
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-left: auto;
    flex-shrink: 0;
    padding-right: 0;
}

.topbar-nav-link {
    text-decoration: none;
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
    padding: 6px 0;
    transition: color 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.topbar-nav-link:hover {
    color: #374151;
}

.topbar-nav-link.active {
    color: #10b981;
    font-weight: 600;
}

.topbar .topbar-center {
    font-weight: 400;
    color: #6b7280;
    letter-spacing: 0.06em;
}

/* Push down the main header so it's not under the fixed topbar */
.topbar + .header {
    margin-top: 81px; /* increased by 30% from 62px */
}

/* Common Grid System */
.grid-container {
    display: grid;
    grid-template-columns: 3fr 4fr 3fr;
    gap: 10px;
    padding: 10px 10px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Desktop Homepage: Three-column balanced layout */
@media (min-width: 1024px) {
    .header .grid-container {
        grid-template-columns: 1fr 1.2fr 1fr;
        gap: 52px; /* increased by 30% from 40px */
        padding: 31px 52px; /* increased by 30% from 24px 40px */
        max-width: 1400px;
    }

    .header-left {
        padding-right: 31px; /* increased by 30% from 24px */
        display: flex;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .header-left .logo-section {
        text-align: left;
        align-items: flex-start;
    }

    .header-center {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 26px; /* increased by 30% from 0 20px */
    }

    .header-right {
        padding-left: 31px; /* increased by 30% from 24px */
        display: flex;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .header-right .features-list {
        width: 100%;
    }

    /* Secondary product section styling */
    .secondary-product-section {
        background: #f9fafb;
        padding: 40px 20px;
    }
}

/* Desktop Main Grid (for idphoto page) - only applies on desktop */
@media (min-width: 1024px) {
    .desktop-main-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 24px;
        align-items: start;
    }
}

.grid-item {
    display: flex;
    flex-direction: column;
    padding: 13px; /* increased by 30% from 10px */
}

/* Header Styles */
.header {
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

/* Hide old logo inside the header to avoid duplication, since it's moved to top-left bar */
.header .logo {
    display: none;
}

.header-left {
    align-items: center;
    justify-content: center;
}

.header-center {
    align-items: center;
    text-align: center;
}

.header-right {
    align-items: center;
    justify-content: center;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.price-info {
    font-weight: bold;
    font-size: 26px; /* increased by 30% from 20px */
    text-align: center;
    margin: 26px; /* increased by 30% from 20px */
}

.price-subtext {
    font-weight: 400;
}

.price-highlight {
    display: block;
    font-size: 36px; /* increased by 30% from 28px */
    font-weight: 700;
    color: #000000;
    margin-top: 5px; /* increased by 30% from 4px */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.features {
    display: flex;
    flex-direction: column;
    gap: 10px; /* increased by 30% from 8px */
    align-items: center;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 16px; /* increased by 30% from 12px */
    align-items: flex-start;
    width: 100%;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9em;
    line-height: 1.4;
}

.feature-check {
    color: #10b981;
    font-weight: bold;
    font-size: 1.1em;
    flex-shrink: 0;
    margin-top: 2px;
}

.feature-text {
    color: #374151;
    flex: 1;
}

.logo {
    font-size: 42px; /* increased by 30% from 32px */
    font-weight: 600;
    color: #1f2937;
}

.studio {
    color: #06B6D4;
}

.tagline {
    font-size: 16px;
    color: #6b7280;
    margin-top: 8px;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 100px;
}

.feature-label {
    font-size: 12px;
    color: #000000;
    font-weight: bold;
    line-height: 1.3;
    max-width: 110px;
    white-space: nowrap;
}

.hero-cta {
    transition: all 0.3s ease;
}

.hero-cta:hover {
    background: #059669 !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.hero-cta:active {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2) !important;
}

.hero-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 20px;
}

.hero-image-wrapper {
    position: relative;
    max-width: 600px;
    width: 100%;
}

.hero-image-single {
    width: 100%;
    height: auto;
    max-height: 200px;
    display: block;
    object-fit: contain;
    object-position: center;
}

.hero-image-label-left,
.hero-image-label-right {
    position: absolute;
    bottom: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    white-space: nowrap;
    z-index: 10;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image-label-left {
    left: 18px; /* Shifted 1cm (10px) to the right to overlap photo */
}

.hero-image-label-right {
    right: 8px;
}


/* Main Content Styles */
.main-content {
    min-height: 500px;
}

.section {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
}

.journey-header {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.3;
}

.journey-subtext {
    font-size: 0.95em;
    color: #6b7280;
    margin-bottom: 24px;
    line-height: 1.5;
}

.step-helper-text {
    font-size: 0.85em;
    color: #6b7280;
    line-height: 1.5;
}

.empty-upload-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    padding: 40px 20px;
}

.upload-icon {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.empty-upload-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-upload-subtext {
    font-size: 0.9em;
    color: #6b7280;
    max-width: 280px;
    line-height: 1.5;
}

.description {
    font-size: 16px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 32px;
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
    display: block;
}

.form-label {
    font-size: 16px;
    font-weight: 700;
    color: #374151;
    display: block;
    margin-bottom: 8px;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    color: #374151;
    background-color: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select:hover {
    border-color: #9ca3af;
}

/* Footer Styles */
.footer {
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.disclaimer {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.6;
}

.disclaimer a {
    color: #3b82f6;
    text-decoration: none;
}

.disclaimer a:hover {
    text-decoration: underline;
}

/* Analysis Section */
.analysis-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 16px;
    margin-top: 16px;
}

.analysis-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

#analysisResults {
    width: 100%;
    height: 150px;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background-color: white;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    resize: vertical;
    color: #495057;
}

#analysisResults:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Photo Container */
.photo-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fa;
    width: 100%;
    max-width: 400px;
    height: 500px;
    margin: 0 auto 20px;
    border: 2px solid #e5e7eb;
    /* Safari-specific fixes */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.photo-container img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    transform-origin: center center;
    /* Safari-specific fixes for image positioning */
    -webkit-transform-origin: center center;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Ensure proper positioning in Safari */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Photo Controls */
.control-group h5 {
    margin: 0 0 8px 0;
    color: white;
    font-size: 0.8em;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    padding: 4px 8px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.navigation-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.horizontal-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vertical-controls {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.zoom-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.reset-controls {
    display: flex;
    justify-content: center;
}

.btn-control {
    background: rgba(102, 126, 234, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.btn-control:hover {
    background: rgba(102, 126, 234, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-control:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#zoomLevel {
    font-weight: bold;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    padding: 2px 6px;
    min-width: 40px;
    text-align: center;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 11px;
}

/* Loading Styles */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.progress-container {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin: 15px 0;
    height: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 8px;
    transition: width 0.3s ease;
    width: 0;
}

.loading-text {
    font-size: 14px;
    color: #374151;
    margin-bottom: 10px;
}

.loading-details {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
}

/* Base button styles */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    height: 36px;
    box-sizing: border-box;
}

/* Primary button (green) */
.btn-primary {
    background-color: #10b981;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #059669;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:active {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Outline green button variant */
.btn-outline-green {
    background-color: #ffffff;
    color: #10b981;
    border: 2px solid #10b981;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-outline-green:hover {
    background-color: rgba(16, 185, 129, 0.08);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-outline-green:active {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

/* Green solid button (used in hero CTA) */
.btn[style*="background: #10b981"],
.btn[style*="background:#10b981"],
a[style*="background: #10b981"],
a[style*="background:#10b981"],
button[style*="background: #10b981"],
button[style*="background:#10b981"] {
    transition: all 0.3s ease !important;
}

.btn[style*="background: #10b981"]:hover,
.btn[style*="background:#10b981"]:hover,
a[style*="background: #10b981"]:hover,
a[style*="background:#10b981"]:hover,
button[style*="background: #10b981"]:hover,
button[style*="background:#10b981"]:hover {
    background-color: #059669 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.btn[style*="background: #10b981"]:active,
.btn[style*="background:#10b981"]:active,
a[style*="background: #10b981"]:active,
a[style*="background:#10b981"]:active,
button[style*="background: #10b981"]:active,
button[style*="background:#10b981"]:active {
    transform: scale(1.02) !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2) !important;
}

.btn-outline-green:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.btn-outline-green:disabled,
.btn-outline-green[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Common button group styles */
.button-group {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    margin-left: 1cm;
    margin-right: 1cm;
    flex-wrap: nowrap;
    width: calc(100% - 2cm);
    box-sizing: border-box;
}

/* Override absolute positioning for specific button groups */
.button-group.static-position {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
}

/* Common face guide and photo border styles */
.face-guide-preview {
    position: absolute;
    border: 3px solid #00ff00;
    border-radius: 50%;
    display: none;
    pointer-events: none;
    opacity: 0.9;
    z-index: 10;
    transition: none;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.face-guide-preview::before {
    content: "Face area";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: #00ff00;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

.photo-border {
    position: absolute;
    border: 3px solid #ff6b35;
    background: transparent;
    pointer-events: none;
    z-index: 5;
    display: none;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.photo-border::before {
    content: "Final photo area";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: #ff6b35;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

/* Common photo controls */
.photo-controls {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: transparent;
    border-radius: 8px;
    padding: 6px;
    z-index: 10;
    display: none; /* Hidden by default */
}

