/* Common styles shared between desktop and mobile versions */

/* 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: center; /* center the middle title */
    padding: 10px 12px;
    position: relative; /* anchor left brand absolutely within */
}

.topbar .topbar-brand {
    position: absolute;
    left: 12px;
    text-decoration: none;
    color: inherit;
}

.topbar .topbar-center {
    font-weight: 700;
    color: #111827;
    letter-spacing: 0.06em;
}

/* Push down the main header so it's not under the fixed topbar */
.topbar + .header {
    margin-top: 48px;
}

/* Common Grid System */
.grid-container {
    display: grid;
    grid-template-columns: 3fr 4fr 3fr;
    gap: 10px;
    padding: 10px 10px;
    max-width: 1200px;
    margin: 0 auto;
}

.grid-item {
    display: flex;
    flex-direction: column;
    padding: 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: 20px;
    text-align: center;
    margin: 20px;
}

.price-highlight {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #000000;
    margin-top: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.logo {
    font-size: 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;
}

/* 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: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
    line-height: 1.3;
}

.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);
    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.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    height: 36px;
    box-sizing: border-box;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

/* Outline green button variant */
.btn-outline-green {
    background-color: #ffffff;
    color: #10b981;
    border: 2px solid #10b981;
    text-decoration: none;
}

.btn-outline-green:hover {
    background-color: rgba(16, 185, 129, 0.08);
}

.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;
    flex-wrap: nowrap;
}

/* 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 */
}

