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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-primary);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    line-height: 1.5;
    /* Prevent double-tap zoom on mobile */
    touch-action: manipulation;
}

/* Add to html for extra security */
html {
    touch-action: manipulation;
}

.page-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
}

.main-content {
    display: flex;
    gap: 1rem;
}

.app-wrapper {
    flex: 1;
    min-width: 0; /* Prevents flexbox overflow */
}

.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-container.ad-top {
    min-height: 100px;
    margin-bottom: 1rem;
}

.ad-container.ad-side {
    width: 200px;
    padding: 2rem;
}

.ad-placeholder {
    background-color: var(--bg-color);
    border: 1px dashed var(--border-color);
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0 0 0;
    /* Prevent zoom on touch */
    touch-action: manipulation;
}

.logo-title-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.logo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
    transition: all 0.3s ease;
    background: white;
    padding: 0.75rem;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    overflow: hidden;
    animation: subtleBounce 4s ease-in-out infinite;
    /* Prevent zoom on touch */
    touch-action: manipulation;
}

@keyframes subtleBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

.logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.logo:hover {
    transform: scale(1.05) rotate(-2deg);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.25);
    border-color: var(--primary-color);
    animation: none;
}

.logo:hover::before {
    opacity: 1;
}

header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    position: relative;
}

header h1::after {
    content: '™';
    font-size: 1rem;
    position: absolute;
    top: 0.5rem;
    right: -1.5rem;
    opacity: 0.5;
    font-weight: 400;
}

header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin: 0;
}

.workspace header {
    padding: 0 0 1.5rem 0;

}

.workspace .logo-title-group {
    gap: 1rem;
    margin-bottom: 0;
}

.workspace .logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    animation: none;
    box-shadow: var(--shadow-sm);
    padding: 0.5rem;
}

.workspace .logo:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.workspace h1 {
    font-size: 1.75rem;
}

.workspace h1::after {
    font-size: 0.75rem;
    right: -1rem;
    top: 0.25rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    background: var(--surface-color);
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: #f0f9ff;
    transform: scale(1.02);
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.upload-area p {
    color: var(--text-primary);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.upload-area .file-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Workspace */
.workspace {
    background: var(--surface-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

.tool-group .tool-btn {
    width: 130px;
    justify-content: center;
}

.tool-separator {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 0.5rem;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.tool-btn:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tool-btn.active {
    background: #e0e7ff;
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

.tool-btn .btn-text, .tool-btn .btn-icon {
    pointer-events: none;
}

/* Scale set state */
.tool-btn.scale-set {
    background: #dcfce7; /* Light green */
    color: #166534; /* Dark green */
    border-color: #16a34a; /* Darker green */
    font-weight: 600;
}

.tool-btn.scale-set:hover {
    background: #fee2e2; /* Light red */
    color: #991b1b; /* Dark red */
    border-color: #ef4444;
}

.tool-btn i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.canvas-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.canvas-actions .tool-btn {
    width: 160px;
    justify-content: center;
}

.scale-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border-color: var(--primary-color);
    color: white;
}

.scale-info span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

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

.zoom-btn i {
    font-size: 1rem;
}

/* Zoom Level with Dropdown */
.zoom-level-container {
    position: relative;
}

.zoom-level {
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 55px;
    width: 55px;
    text-align: center;
    color: var(--text-secondary);
    cursor: default;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    user-select: none;
    font-variant-numeric: tabular-nums;
}

/* Unit Toggle */
.unit-toggle {
    display: flex;
    background: var(--bg-color);
    border-radius: 0.5rem;
    padding: 0.25rem;
    gap: 0.25rem;
}

.unit-btn {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.unit-btn:hover {
    background: var(--surface-color);
}

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

/* Canvas Container */
.canvas-container {
    position: relative;
    background: var(--bg-color);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

#canvas {
    cursor: crosshair;
    box-shadow: var(--shadow-md);
}

#canvas.pan-mode {
    cursor: grab;
}

#canvas.pan-mode:active {
    cursor: grabbing;
}

/* Crop Overlay */
.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* Measurements */
.measurements {
    background: var(--bg-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5vw;
}

.measurements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.measurements-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.measurements-header .btn {
    padding: 0.5rem 0.75rem;
}

.add-category-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.add-category-btn i {
    font-size: 0.875rem;
}

.categories-list {
    margin-bottom: 1rem;
}

.category {
    margin-bottom: 1rem;
    background: var(--surface-color);
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.category:last-child {
    margin-bottom: 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.category-header:hover {
    background: var(--surface-hover, #f3f4f6);
}

.category-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: text;
    padding: 0.25rem 0.5rem;
    padding-right: 1.75rem;
    margin: -0.25rem -0.5rem;
    border-radius: 0.25rem;
    transition: background 0.2s ease;
    position: relative;
    display: inline-block;
}

.category-name::after {
    font-family: "Font Awesome 6 Free";
    content: '\f044'; /* fa-pen-to-square */
    font-weight: 400; /* Regular weight */
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    color: var(--text-secondary);
}

.category-header:hover .category-name::after {
    opacity: 0.5;
    line-height: 20px;
}

.category-name:hover {
    background: var(--surface-color);
}

.category-name:hover::after {
    opacity: 0.7;
}

.category-name.editing {
    background: var(--surface-color);
    border: 1px solid var(--primary-color);
    outline: none;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    padding-right: 0.5rem;
}

.category-name.editing::after {
    display: none;
}

.category-total {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.category-items {
    padding: 0.5rem;
    min-height: 3rem;
    transition: background 0.2s ease;
}

.category-items.drag-over {
    background: var(--primary-light, #dbeafe);
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.category-items .empty-state {
    font-size: 0.813rem;
    padding: 1rem;
    margin: 0;
}

.measurement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--surface-color);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
    cursor: move;
    transition: all 0.2s ease;
}

.measurement-item.dragging {
    opacity: 0.5;
}

.measurement-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.measurement-item .color-indicator {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    margin-right: 0.75rem;
}

.measurement-item .area-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.measurement-item .area-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: flex-start; /* This is the fix */
}

.measurement-item .area-name {
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-block;
    position: relative;
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem;
    padding-right: 1.75rem; /* Space for the icon */
    border-radius: 0.25rem;
    transition: background 0.2s ease;
}

.measurement-item .area-name:hover {
    background: var(--bg-color);
}

.measurement-item .area-name::after {
    font-family: "Font Awesome 6 Free";
    content: '\f044';
    font-weight: 400;
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    color: var(--text-secondary);
    font-size: 0.875rem;
    pointer-events: none;
}

.measurement-item:hover .area-name::after {
    opacity: 0.5;
}

.measurement-item .area-name:hover::after {
    opacity: 1;
}

.measurement-item .area-name.editing {
    background: var(--surface-color);
    border: 1px solid var(--primary-color);
    outline: none;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    padding-right: 0.5rem;
}

.measurement-item .area-name.editing::after {
    display: none;
}

.measurement-item .area-value {
    font-size: 0.875rem;
    color: var(--text-secondary);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.measurement-item .delete-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0.25rem;
}

.measurement-item .delete-btn:hover {
    opacity: 0.7;
}

.measurement-item .delete-btn i {
    font-size: 1.125rem;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.total-area {
    padding: 1rem;
    background: var(--surface-color);
    border-radius: 0.375rem;
    text-align: center;
    border: 2px solid var(--border-color);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.total-area span {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

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

.modal-content {
    background: var(--surface-color);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

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

.modal-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.scale-input-group {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.scale-input-group input[type="number"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
}

.scale-input-group select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
}

.measurement-name-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.measurement-name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn i {
    font-size: 0.875rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.toast i {
    font-size: 1.25rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    .ad-container.ad-side {
        width: 100%;
        min-height: 100px;
    }
    .ad-container.ad-side-left {
        order: 3;
    }
    .ad-container.ad-side-right {
        order: 4;
    }
}

@media (max-width: 768px) {
    .page-container, .container {
        padding: 0.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .tool-group {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Make toolbar buttons full width and stack vertically */
    .tool-btn {
        width: 100%;
        min-width: auto;
        padding: 0.75rem 1rem;
        justify-content: center;
        min-height: 48px;
        font-size: 1rem;
    }
    
    /* Ensure all tool button icons have proper spacing */
    .tool-btn i {
        margin-right: 0.5rem;
    }
    
    /* Remove icon-only styling - show text again */
    #moveBtn, #clearBtn {
        min-width: auto;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        width: 100%;
    }
    
    #moveBtn i, #clearBtn i {
        font-size: 1rem;
        margin-right: 0.5rem;
    }
    
    /* Show Draw Area text */
    #drawBtn .btn-text {
        display: inline;
    }
    
    /* Keep draw button same size as others */
    #drawBtn {
        min-width: auto;
        padding: 0.75rem 1rem;
        width: 100%;
    }
    
    /* Show text for New button */
    #newProjectBtn {
        font-size: 1rem;
    }
    
    #newProjectBtn i {
        font-size: 1rem;
        margin-right: 0.5rem;
    }
    
    /* Show text for Download button */
    #downloadBtn {
        font-size: 1rem;
    }
    
    #downloadBtn i {
        font-size: 1rem;
        margin-right: 0.5rem;
    }
    
    /* Make unit toggle buttons smaller on mobile */
    .unit-toggle {
        gap: 0.125rem;
        padding: 0.125rem;
    }
    
    .unit-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
        min-height: 32px;
    }
    
    /* Stack canvas-actions buttons vertically */
    .canvas-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .canvas-actions .tool-btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
        font-size: 1rem;
    }
    
    /* Show text for Scale button since it's important */
    #scaleBtn {
        font-size: 1rem;
    }
    
    /* Make measurement names smaller on mobile */
    .measurement-item .area-name {
        font-size: 0.875rem;
        font-weight: 500;
    }
    
    .measurement-item .area-value {
        font-size: 0.875rem;
    }
    
    .measurement-item {
        padding: 0.75rem;
    }
    
    .canvas-container {
        min-height: 300px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon i {
        font-size: 1.75rem;
    }
    
    .use-cases-grid {
        grid-template-columns: 1fr;
    }
    
    .use-case-card {
        padding: 1.5rem;
    }
    
    /* Fix dropdown to be full width on mobile */
    .dropdown {
        width: 100%;
    }
}

/* Measurement Labels on Canvas */
.measurement-label {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    pointer-events: none;
    white-space: nowrap;
}

/* Selectable text areas */
input, textarea {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.notification.show {
    transform: translateX(0);
}

/* Dropdown container */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    width: 100%;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
}

.dropdown-content button {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
}

.dropdown-content button i {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    font-size: 1rem;
    text-align: center;
    line-height: 20px;
}

.dropdown-content button:hover {
    background-color: #f1f1f1;
}

.seo-content {
    background-color: var(--surface-color);
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 2rem;
    color: var(--text-primary);
}

/* Hide SEO sections when workspace is active */
.workspace-active .seo-content > div:not(:last-child):not(.upload-section) {
    display: none;
}

.workspace-active .seo-content > h3:not(:last-of-type) {
    display: none;
}

.workspace-active .seo-content .upload-section {
    display: none;
}

.seo-content h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.seo-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Add specific styling for the disclaimer heading */
.seo-content h3:last-of-type {
    margin-top: 5rem;
}

.seo-content p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

.seo-content ul {
    list-style-position: inside;
    padding-left: 0;
}

.seo-content .use-cases {
    columns: 2;
    -webkit-columns: 2;
    -moz-columns: 2;
    column-gap: 2rem;
}

.seo-content li {
    margin-bottom: 0.5rem;
}

.seo-content .disclaimer-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--secondary-color);
    text-align: justify;
}

/* Disclaimer Bubbles */
.disclaimer-bubbles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.disclaimer-bubble {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.disclaimer-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.disclaimer-bubble i {
    font-size: 1.25rem;
    color: var(--primary-color);
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
}

.disclaimer-bubble p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    text-align: left;
    flex: 1;
}

@media (max-width: 768px) {
    .disclaimer-bubbles {
        gap: 0.75rem;
    }
    
    .disclaimer-bubble {
        padding: 1rem;
    }
    
    .disclaimer-bubble i {
        font-size: 1rem;
    }
    
    .disclaimer-bubble p {
        font-size: 0.7rem;
    }
}

/* Modern Step Flow */
.steps-flow-container {
    display: flex;
    justify-content: center;
    margin: 0 0 4rem 0;
    padding: 0 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.steps-flow {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 1.5rem;
    border: 1px solid #e5e7eb;
}

.step-flow-card {
    text-align: center;
    position: relative;
    padding: 1.5rem;
    background: white;
    border-radius: 1rem;
    transition: all 0.3s ease;
    min-width: 140px;
    border: 2px solid transparent;
}

.step-flow-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
    border-color: var(--primary-color);
}

.step-icon-large {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #4f46e5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
    position: relative;
    transition: all 0.3s ease;
}

.step-flow-card:hover .step-icon-large {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.35);
}

.step-icon-large i {
    font-size: 2rem;
    color: white;
}

.step-number {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.step-flow-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.step-flow-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
}

.step-arrow {
    color: #d1d5db;
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateX(3px);
    }
}

/* Animate on scroll */
.step-flow-card {
    animation: fadeInScale 0.6s ease forwards;
    opacity: 0;
    transform: scale(0.9);
}

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.step-flow-card:nth-child(1) { animation-delay: 0.1s; }
.step-flow-card:nth-child(3) { animation-delay: 0.2s; }
.step-flow-card:nth-child(5) { animation-delay: 0.3s; }
.step-flow-card:nth-child(7) { animation-delay: 0.4s; }
.step-flow-card:nth-child(9) { animation-delay: 0.5s; }

.step-arrow:nth-child(2) { animation-delay: 0.15s; }
.step-arrow:nth-child(4) { animation-delay: 0.25s; }
.step-arrow:nth-child(6) { animation-delay: 0.35s; }
.step-arrow:nth-child(8) { animation-delay: 0.45s; }

/* Mobile responsive */
@media (max-width: 768px) {
    .steps-flow-container {
        padding: 0;
    }
    
    .steps-flow {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 0.75rem;
        padding: 1rem;
        justify-content: center;
    }
    
    /* First card (Upload) takes full width */
    .step-flow-card:nth-child(1) {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 300px;
        margin: 0 auto 0.5rem;
        justify-self: center;
    }
    
    /* All cards have equal size */
    .step-flow-card {
        min-width: 0;
        width: 100%;
        padding: 1rem;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 150px;
        position: relative;
    }
    
    .step-icon-large {
        width: 60px;
        height: 60px;
        margin-bottom: 0.75rem;
    }
    
    .step-icon-large i {
        font-size: 1.5rem;
    }
    
    .step-number {
        top: -5px;
        right: -5px;
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .step-arrow {
        display: none;
    }
    
    /* Remove the arrow after step 5 */
    .step-flow-card::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .steps-flow {
        grid-gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .step-flow-card {
        padding: 0.75rem;
        min-height: 140px;
    }
    
    .step-flow-card h4 {
        font-size: 1rem;
    }
    
    .step-flow-card p {
        font-size: 0.75rem;
    }
}

/* Section Intro (shared styling) */
.section-intro,
.features-intro,
.uses-intro {
    text-align: center;
    margin: 4rem 0 3rem 0;
    padding: 0rem 1rem;
    animation: fadeInScale 0.8s ease forwards;
}

.section-main-title,
.features-main-title {
    font-size: 5.5rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.1;
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.features-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 1.5rem auto 0;
    max-width: 600px;
    line-height: 1.6;
}

@media (max-width: 1600px) {
    .section-main-title,
    .features-main-title {
        font-size: 4.5rem;
    }
}

@media (max-width: 1400px) {
    .section-main-title,
    .features-main-title {
        font-size: 4rem;
    }
}

@media (max-width: 1200px) {
    .section-main-title,
    .features-main-title {
        font-size: 3.5rem;
    }
}

@media (max-width: 1024px) {
    .section-main-title,
    .features-main-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .section-main-title,
    .features-main-title {
        font-size: 2.75rem;
        white-space: normal;
    }
    
    .features-subtitle {
        font-size: 1.125rem;
    }
}

@media (max-width: 600px) {
    .section-main-title,
    .features-main-title {
        font-size: 2.25rem;
    }
}

@media (max-width: 480px) {
    .section-main-title,
    .features-main-title {
        font-size: 2rem;
    }
}

/* Feature Sections */
.features-section {
    margin-bottom: 3rem;
}

.features-section:last-child {
    margin-bottom: 0;
}

.feature-subheader {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.feature-subheader i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* Feature Cards */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 0 0 1rem 0;
}

.feature-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.feature-card:hover::after {
    opacity: 0.05;
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #e0e7ff 0%, #f0f4ff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.feature-icon i {
    font-size: 1.75rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4f46e5 100%);
}

.feature-card:hover .feature-icon i {
    color: white;
    transform: scale(1.1);
}

.feature-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Animate feature cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.feature-card:nth-child(1) { animation-delay: 0.05s; }
.feature-card:nth-child(2) { animation-delay: 0.1s; }
.feature-card:nth-child(3) { animation-delay: 0.15s; }
.feature-card:nth-child(4) { animation-delay: 0.2s; }
.feature-card:nth-child(5) { animation-delay: 0.25s; }
.feature-card:nth-child(6) { animation-delay: 0.3s; }
.feature-card:nth-child(7) { animation-delay: 0.35s; }
.feature-card:nth-child(8) { animation-delay: 0.4s; }
.feature-card:nth-child(9) { animation-delay: 0.45s; }

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .feature-card {
        padding: 1rem;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
    }
    
    .feature-icon i {
        font-size: 1.5rem;
    }
}

/* Combined Features Grid */
.features-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 0 0 3rem 0;
    padding: 0 1rem;
}

@media (max-width: 768px) {
    .features-grid-full {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
        padding: 0;
    }
}

@media (max-width: 480px) {
    .features-grid-full {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Feature Cards */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 0 0 1rem 0;
}

/* Popular Uses Section */
.uses-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    animation: fadeIn 0.8s ease 0.3s both;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 1rem 0;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.use-case-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.use-case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.use-case-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color-light);
}

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

.use-case-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color-light), var(--secondary-color-light));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.use-case-card:hover .use-case-icon {
    transform: rotate(10deg) scale(1.1);
}

.use-case-card h4 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.use-case-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.use-case-card ul li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.use-case-card ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

/* Hero Intro Section */
.hero-intro {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
    border-radius: 24px;
    padding: 4rem 3rem;
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.hero-intro::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

.hero-intro::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -30%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(30px, -30px) rotate(180deg);
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
    line-height: 1.2;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    animation: fadeInUp 0.8s ease both;
}

.hero-description {
    text-align: justify;
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-description p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    word-spacing: -0.05em;
    text-align-last: left;
}

/* On medium screens, use left align to avoid large gaps */
@media (max-width: 1024px) {
    .hero-description p {
        text-align: justify;
        hyphens: none;
        word-spacing: normal;
    }
}

.hero-description p:last-child {
    margin-bottom: 0;
}

.hero-description strong {
    color: var(--primary-color);
    font-weight: 700;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.hero-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color-light);
}

.hero-badge i {
    font-size: 1.25rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.hero-badge:hover i {
    transform: scale(1.1) rotate(5deg);
}

.hero-badge span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 1200px) {
    .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .hero-intro {
        padding: 3rem 2rem;
        margin-bottom: 3rem;
    }
    
    /* Hide spinning backgrounds on mobile */
    .hero-intro::before,
    .hero-intro::after {
        display: none;
    }
    
    .hero-title {
        font-size: 2.25rem;
        margin-bottom: 2rem;
    }
    
    .hero-description p {
        font-size: 1rem;
        text-align: left;
    }
    
    .hero-badges {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-top: 2rem;
        justify-items: center;
    }
    
    .hero-badge {
        padding: 0.6rem 1rem;
        width: 100%;
        max-width: 140px;
        justify-content: center;
    }
    
    .hero-badge i {
        font-size: 1.1rem;
    }
    
    .hero-badge span {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .hero-intro {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }
    
    /* Ensure backgrounds are hidden on small screens too */
    .hero-intro::before,
    .hero-intro::after {
        display: none;
    }
    
    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-badges {
        gap: 0.5rem;
    }
    
    .hero-badge {
        padding: 0.5rem 0.75rem;
        max-width: 120px;
    }
    
    .hero-badge i {
        font-size: 0.9rem;
    }
    
    .hero-badge span {
        font-size: 0.7rem;
    }
}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
    /* Increase button sizes for touch */
    .tool-btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .tool-btn i {
        font-size: 1.125rem;
    }
    
    /* Larger zoom controls */
    .zoom-btn {
        width: 44px;
        height: 44px;
    }
    
    .zoom-btn i {
        font-size: 1.25rem;
    }
    
    .zoom-level {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Larger dropdown items */
    .dropdown-content button {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }
    
    /* Better spacing for measurements */
    .measurement-item {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .measurement-item .delete-btn {
        width: 44px;
        height: 44px;
    }
    
    /* Modal improvements */
    .modal-content {
        width: 90%;
        padding: 2rem;
    }
    
    .modal-buttons .btn {
        min-height: 48px;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Better touch targets for categories */
    .category-header {
        padding: 1rem;
        min-height: 56px;
    }
    
    /* Prevent accidental zooming */
    input[type="text"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Add touch feedback */
    button:active,
    .tool-btn:active,
    .zoom-btn:active,
    .unit-btn:active {
        transform: scale(0.95);
    }
}

/* Touch-specific cursor styles */
@media (hover: none) {
    #canvas {
        cursor: default !important;
    }
    
    #canvas.pan-mode {
        cursor: default !important;
    }
    
    .upload-area {
        cursor: default;
    }
}

/* Prevent text selection on touch devices */
@media (hover: none) and (pointer: coarse) {
    * {
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Ensure all interactive elements prevent zoom */
    button, input, select, textarea, .logo, header, .upload-area {
        touch-action: manipulation;
    }
}

@media (max-width: 900px) {
    .seo-content .use-cases {
        columns: 1;
        -webkit-columns: 1;
        -moz-columns: 1;
    }
}

/* Upload section styles when inside SEO content */
.seo-content .upload-section {
    margin: 3rem 0;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.seo-content .upload-area {
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    border: 3px dashed var(--primary-color);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.12);
    padding: 3rem 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.seo-content .upload-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

.seo-content .upload-area:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #ffffff 0%, #e8ecff 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.18);
}

.seo-content .upload-area i {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.seo-content .upload-area p:first-of-type {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.seo-content .upload-area .file-info {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.seo-content .upload-area .privacy-info {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-style: italic;
    margin-top: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 0.5rem;
    position: relative;
}

.seo-content .upload-area .cta-action {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.seo-content .upload-area .browse-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    transition: all 0.2s ease;
}

.seo-content .upload-area .browse-link:hover {
    color: var(--primary-dark, #1d4ed8);
    text-decoration: none;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Mobile styles for CTA upload area */
@media (max-width: 768px) {
    .seo-content .upload-section {
        margin: 2rem 0;
    }
    
    .seo-content .upload-area {
        padding: 2rem 1.5rem;
    }
    
    .seo-content .upload-area i {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .seo-content .upload-area p:first-of-type {
        font-size: 1.25rem;
    }
    
    .seo-content .upload-area .file-info {
        font-size: 0.875rem;
    }
    
    .seo-content .upload-area .privacy-info {
        font-size: 0.75rem;
        padding: 0.5rem 1.25rem;
    }
}

.measurements-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 0.75rem;
}

.category-list-header, .length-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.measurements-total {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-area {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
}

.btn-link-danger {
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    padding: 0;
}

.btn-link-danger:hover {
    color: #dc2626; /* Darker red */
}

.btn-icon-only {
    font-size: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#saveToast, .custom-popup {
    display: none;
    position: fixed;
}

 