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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

html {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0;
    padding: 0;
}

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

/* Header */
.header {
    background: var(--bg-color);
    border: none !important;
    border-bottom: none !important;
    border-top: none !important;
    padding: 2rem 0 0;
    position: relative;
    z-index: 100;
    outline: none !important;
    box-shadow: none !important;
    margin: 0;
}

.home-header {
    background: var(--bg-color);
    border-bottom: none;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    cursor: pointer;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

/* Main Content */
.main {
    flex: 1;
    padding: 2rem 0;
}

.section {
    display: none;
}

.section.active {
    display: block;
}


/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

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

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-large svg {
    flex-shrink: 0;
}


/* Crop Section - New Design */
.editor-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 0;
    min-height: auto;
    background: var(--bg-color);
    align-items: start;
}

.editor-sidebar {
    background: var(--bg-color);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: visible;
    height: auto;
    display: flex;
    flex-direction: column;
}

.file-size-limit {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    text-align: center;
}

.settings-section {
    margin-bottom: 1.5rem;
}

/* shadcn-style Form Elements */
.form-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
    touch-action: manipulation;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.form-select-small {
    width: auto;
    min-width: 80px;
    padding-right: 2rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.radio-label:hover {
    background: var(--bg-secondary);
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.radio-label span {
    user-select: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.checkbox-label:hover {
    color: var(--primary-color);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    user-select: none;
}

.size-inputs-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.input-group {
    flex: 1;
}

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

.file-size-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.file-size-row .form-input {
    flex: 1;
}

.file-size-row .form-input:disabled,
.file-size-row .form-select:disabled {
    cursor: not-allowed;
    background: var(--bg-secondary);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}


.btn-export {
    width: 100%;
    padding: 0.625rem 1rem;
    margin-top: auto;
    font-size: 0.875rem;
    font-weight: 500;
}

.editor-preview {
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    height: calc(100vh - 200px);
    width: 100%;
    max-width: 100%;
}

.preview-controls-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    min-height: 40px;
}

.preview-filename-container {
    flex: 1;
    max-width: 300px;
}

.preview-filename-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-size: 16px; /* Prevent iOS zoom - must be at least 16px */
    font-family: inherit;
    transition: all 0.2s;
}

.preview-filename-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.preview-filename-input::placeholder {
    color: var(--text-secondary);
}

.preview-actions {
    display: flex;
    gap: 0.75rem;
}

.preview-actions-mobile {
    display: none;
}

.preview-action-btn {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.preview-action-btn[style*="flex"] {
    display: flex !important;
}

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

.canvas-container {
    position: relative;
    flex: 1;
    min-height: 400px;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    touch-action: pan-x pan-y;
}

#crop-canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    image-rendering: auto;
    object-fit: contain;
}

.empty-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-secondary);
}

.empty-preview.hidden {
    display: none;
}

.empty-preview svg {
    opacity: 0.5;
}


.crop-sidebar {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    height: fit-content;
    position: sticky;
    top: 100px;
}

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

.crop-sidebar h2 {
    font-size: 1.5rem;
    margin: 0;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
}

.crop-sidebar h3 {
    font-size: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-tertiary);
}

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

.upload-content svg {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.upload-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.upload-hint {
    font-size: 0.75rem !important;
    margin-top: 0.5rem;
}

.upload-options {
    margin-bottom: 1rem;
}

.upload-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.upload-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.upload-tab:hover {
    color: var(--text-primary);
}

.upload-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

.upload-tab-content {
    display: none;
}

.upload-tab-content.active {
    display: block;
}

.url-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.url-input {
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s;
    font-family: inherit;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.url-input::placeholder {
    color: var(--text-secondary);
}

.url-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.preset-btn {
    padding: 0.625rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.size-inputs {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.size-inputs input {
    flex: 1;
    padding: 0.5rem 0.625rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.8125rem;
    max-width: 100px;
}

.size-inputs input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.size-inputs span {
    color: var(--text-secondary);
}

.crop-mode-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.crop-mode-buttons .btn {
    flex: 1;
    min-width: 80px;
}

.crop-mode-buttons .btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.download-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.download-section .btn {
    width: 100%;
}

.crop-canvas-area {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.canvas-container {
    position: relative;
    flex: 1;
    min-height: 500px;
    background: #f8fafc;
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

#crop-canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.canvas-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.crop-guide {
    position: absolute;
    border: 2px dashed var(--primary-color);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
}

.canvas-info {
    margin-top: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Collections */
.collections-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.collections-header h2 {
    font-size: 2rem;
}

.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.collection-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.collection-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}


/* Home Page - shadcn Inspired */
.home-page {
    min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero-section {
    padding: 1rem 0 4rem;
    background: var(--bg-color);
}

.hero-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 3rem;
}

/* Home Upload Section */
.home-upload-section {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.home-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-color);
    margin-bottom: 1.5rem;
    position: relative;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

#home-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

#home-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
    opacity: 0;
}

.home-upload-area:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.home-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.home-upload-content svg {
    display: none;
}

.home-upload-text {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.home-upload-text strong {
    font-weight: 600;
}

.browse-link {
    color: var(--primary-color);
    font-weight: 600;
}

.btn-upload {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

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

.home-upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.upload-features {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-check {
    font-size: 0.875rem;
    color: var(--success-color);
    font-weight: 500;
}

.legal-disclaimer {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0;
}

.legal-link {
    color: var(--primary-color);
    text-decoration: none;
}

.legal-link:hover {
    text-decoration: underline;
}

/* Features Section */
.features-section {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    transition: all 0.2s;
}

.feature-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9375rem;
}

/* CTA Section */
.cta-section {
    padding: 4rem 0;
    background: var(--bg-color);
}

.cta-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cta-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.cta-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.cta-card .btn {
    margin: 0 auto;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.footer-brand h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-brand h3 svg {
    flex-shrink: 0;
}

.footer-brand p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.footer-nav {
    flex: 1;
    max-width: 400px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8125rem;
}

.footer-bottom a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-bottom a:hover {
    color: var(--primary-color);
}

/* Page Content Styles */
.page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.page-body {
    line-height: 1.8;
    color: var(--text-primary);
}

.page-body .lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 500;
}

.page-body h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.page-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.page-body p {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.page-body ul,
.page-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.page-body li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.page-body a {
    color: var(--primary-color);
    text-decoration: none;
}

.page-body a:hover {
    text-decoration: underline;
}

.last-updated {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.contact-info {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.contact-info h2 {
    margin-top: 0;
    font-size: 1.25rem;
}

.contact-link {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .crop-container {
        grid-template-columns: 1fr;
    }

    .crop-sidebar {
        position: static;
    }

    .editor-container {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }

    .editor-sidebar {
        order: 2;
        border-right: none;
        border-bottom: none;
        border-top: 1px solid var(--border-color);
        height: auto;
        overflow-y: visible;
    }

    .editor-preview {
        order: 1;
        height: auto;
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        width: 100%;
        justify-content: center;
    }

    .collections-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .home-upload-area {
        padding: 2rem 1.5rem;
        width: 100%;
        max-width: 100%;
    }

    .upload-features {
        flex-direction: column;
        gap: 0.75rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .cta-card {
        padding: 2rem;
    }

    .cta-title {
        font-size: 1.75rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-body .lead {
        font-size: 1.125rem;
    }

    .home-upload-area {
        padding: 2rem 1.5rem;
        width: 100%;
        max-width: 100%;
    }

    .editor-container {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }

    .editor-sidebar {
        order: 2;
        border-right: none;
        border-bottom: none;
        border-top: 1px solid var(--border-color);
        height: auto;
        overflow-y: visible;
    }

    .editor-preview {
        order: 1;
        height: auto;
        min-height: 400px;
        width: 100%;
        max-width: 100%;
        padding: 1rem;
    }

    .canvas-container {
        min-height: 50vh;
        max-height: 70vh;
        width: 100%;
        max-width: 100%;
    }

    .preview-controls-top {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .preview-filename-container {
        max-width: 100%;
    }

    .preview-actions-desktop {
        display: none;
    }

    .preview-actions-mobile {
        display: flex;
        gap: 0.5rem;
        margin-top: 1rem;
        width: 100%;
        justify-content: space-between;
    }

    .preview-actions-mobile .preview-action-btn {
        flex: 1;
        min-width: 0;
        padding: 0.5rem 0.5rem;
        font-size: 0.8125rem;
    }
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: -9999px;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 1000;
    border-radius: 0 0 0.25rem 0;
    border: none;
    outline: none;
    opacity: 0;
    visibility: hidden;
}

.skip-link:focus {
    top: 0;
    left: 0;
    opacity: 1;
    visibility: visible;
}

.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;
}

/* Focus indicators */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.nav-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.preview-action-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Keyboard navigation improvements */
button,
input,
select,
textarea,
[role="button"],
[tabindex="0"] {
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
    
    .btn-primary {
        border: 2px solid var(--primary-color);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile specific improvements */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .container {
        padding: 0 1rem;
    }

    .header {
        padding: 1rem 0;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.75rem;
    }

    .nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
        flex: 1;
        min-width: 80px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 0.9375rem;
    }

    .home-upload-area {
        padding: 1.5rem 1rem;
        width: 100%;
        max-width: 100%;
    }

    .home-upload-content {
        gap: 1rem;
    }

    .btn-upload {
        padding: 0.625rem 1.5rem;
        font-size: 0.9375rem;
    }

    .upload-features {
        flex-direction: column;
        gap: 0.5rem;
    }

    .editor-sidebar {
        padding: 1rem;
    }

    .settings-section {
        margin-bottom: 1rem;
    }

    .form-input,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .preview-action-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .canvas-container {
        min-height: 50vh;
        max-height: 60vh;
        width: 100%;
        max-width: 100%;
        padding: 0.5rem;
    }

    #crop-canvas {
        max-width: 100%;
        max-height: 100%;
    }

    .preview-controls-top {
        width: 100%;
        max-width: 100%;
    }

    .preview-actions-mobile {
        width: 100%;
        max-width: 100%;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: flex-start;
        align-items: flex-start;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .page-body h2 {
        font-size: 1.25rem;
    }

    .contact-info {
        padding: 1rem;
    }
}

