:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #6366f1;
  --background: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --error: #ef4444;
  --success: #22c55e;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
}

.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

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

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

.hero {
  text-align: center;
  margin: 4rem 0 6rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.subtitle {
  font-size: 1.2rem;
  line-height: 1.6;
  max-width: 800px;
  margin: 1.5rem auto;
  color: #333;
}

.subtitle a {
  color: #007bff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.subtitle a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.try-it-free {
  font-size: 1.8rem;
  text-align: center;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: #2c3e50;
}

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

.upload-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

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

.upload-icon {
  width: 48px;
  height: 48px;
  fill: var(--primary);
}

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

.preview-image {
  max-width: 100%;
  margin-top: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.prompt-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.task-input {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.3s ease;
}

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

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

button:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
  transform: none;
}

.button-loader {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.results-section {
  background: var(--surface);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.results-section h2 {
  color: var(--text);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.result-section {
    margin: 20px 0;
    padding: 15px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.collapsible {
  display: flex;
  gap: 1rem;
}

.toggle-icon {
  margin-top: .4rem;
}

.result-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.json-display {
  background: var(--background);
  padding: 1.5rem;
  border-radius: 0.75rem;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-x: auto;
}

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

.split-image {
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  transition: transform 0.3s ease;
}

.split-image:hover {
  transform: scale(1.05);
}

.visualization-container {
  position: relative;
}

#visualizationCanvas {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.visualization-canvas {
    border: 1px solid #ccc;
    background-color: white;
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.visualization-canvas:not([width]) {
    min-height: 200px;
}

.element-tooltip {
  display: none;
  position: fixed;
  background: rgba(15, 23, 42, 0.9);
  color: white;
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  max-width: 300px;
  z-index: 1000;
  pointer-events: none;
  backdrop-filter: blur(4px);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  text-align: center;
}

.footer-links {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

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

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

@media (max-width: 768px) {
    /* Exclude pricing page from mobile styles */
    body:not(.pricing-page) .nav-links {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface);
        padding: 1rem;
        border-top: 1px solid var(--border);
        justify-content: space-around;
        z-index: 100;
    }
    
    body:not(.pricing-page) .nav-links a {
        font-size: 0.875rem;
    }
    
    body:not(.pricing-page) .user-menu-container {
        position: fixed;
        top: 1rem;
        right: 1rem;
    }
    
    body:not(.pricing-page) .google-sign-in-button {
        padding: 0.5rem;
    }
    
    body:not(.pricing-page) .sign-in-text {
        display: none;
    }
    
    body:not(.pricing-page) .user-dropdown {
        position: fixed !important;
        top: 4rem !important;
        right: 1rem !important;
        left: 1rem !important;
        background: var(--surface);
        border-radius: 1rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    body:not(.pricing-page) .user-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1rem;
    }
    
    body:not(.pricing-page) .user-details {
        margin-top: 0.5rem;
    }
    
    body:not(.pricing-page) .profile-pic {
        width: 48px;
        height: 48px;
    }
    
    body:not(.pricing-page) h1 {
        font-size: 2rem;
    }
    
    body:not(.pricing-page) .container {
        padding: 1rem;
        padding-bottom: 5rem;
    }
    
    body:not(.pricing-page) .results-section {
        padding: 1rem;
    }
}

.section-content.collapsed {
    display: none;
}

/* Add these styles to your existing CSS */
.password-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 2rem;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    max-width: 400px;
    width: 90%;
    margin: 0;
}

.password-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.password-dialog h2 {
    color: var(--text);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

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

.password-dialog input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s ease;
}

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

.dialog-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.dialog-buttons button {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.dialog-buttons button[type="button"] {
    background-color: var(--text-secondary);
}

.dialog-buttons button[type="button"]:hover {
    background-color: var(--text);
}

.user-menu-container {
    margin-left: auto;
}

.google-sign-in-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: #757575;
    border: 1px solid #ddd;
    padding: 0.75rem 1rem;
    border-radius: 2rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.google-sign-in-button:hover {
    background-color: #f8f9fa;
    transform: none;
}

.google-sign-in-button img {
    width: 20px;
    height: 20px;
}

.profile-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.user-dropdown {
    min-width: 250px;
    padding: 1.5rem;
}

.user-info {
    gap: 1.5rem;
}

.user-details {
    flex: 1;
}

.dropdown-item {
    border-radius: 0.5rem;
    font-weight: 500;
    color: var(--error);
}

.user-profile {
    position: relative;
    cursor: pointer;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--surface);
    border-radius: 1rem;
    min-width: 250px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    z-index: 1000;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: var(--text);
}

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

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

.dropdown-item {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    background: transparent;
    color: var(--text);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--background);
    transform: none;
}

/* Animation for dropdown */
.user-dropdown {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.user-dropdown[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

/* Profile picture hover effect */
.profile-pic {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.user-profile:hover .profile-pic {
    transform: scale(1.05);
    border-color: var(--primary-hover);
}

/* Add these styles to your existing styles.css */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.legal-content h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary);
}

.legal-content h2 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.legal-content p, .legal-content ul {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.legal-content ul {
    padding-left: 2rem;
}

.legal-content .copyright {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.875rem;
}

.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 15px 25px;
    border-radius: 12px;
    z-index: 1000;
    display: none;
    backdrop-filter: blur(10px);
    max-width: 90%;
    width: 400px;
}

.cookie-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cookie-content p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.cookie-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    align-items: center;
}

.cookie-buttons a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.cookie-buttons a:hover {
    text-decoration: underline;
}

.cookie-buttons button {
    background: #007AFF;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.cookie-buttons button:hover {
    background: #0056b3;
}

@keyframes wiggle {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.wiggle {
    animation: wiggle 0.5s ease;
}

/* Add these styles to your existing styles.css */
.terms-checkbox {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.terms-checkbox input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
}

.terms-checkbox label {
    cursor: pointer;
}

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

.terms-checkbox a:hover {
    text-decoration: underline;
}

@keyframes wiggle {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.wiggle {
    animation: wiggle 0.5s ease;
}

.mechanism-selector {
  margin-bottom: 20px;
  width: 100%;
  max-width: 600px;
}

.select-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--background);
  color: var(--text);
  font-size: 16px;
  margin-top: 8px;
}

.try-it-heading {
  text-align: center;
}

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

.mechanism-selection {
    margin: 2rem 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.mechanism-selection label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

.mechanism-select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    font-size: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mechanism-select:hover {
    border-color: #999;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mechanism-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.maintenance-overlay {
  /*position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg); */
  color: rgba(255, 0, 0, 0.6);
  font-size: 24px;
  font-weight: bold;
  padding: 20px;
  text-align: center;
  /*width: 100%;*/
  z-index: 1000;  
  white-space: pre-wrap;
  /*max-width: 600px;*/  
  line-height: 1.4;
}

.upload-card, .prompt-container {
  position: relative;
  opacity: 0.7;
}

/*
.mechanism-select, .task-input, #processButton {
  cursor: not-allowed;
}*/

.mechanism-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.mechanism-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.mechanism-checkbox-list input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.all-results-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1rem;
}

.mechanism-result {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.mechanism-result h3 {
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.loading-indicator {
    color: #666;
    font-style: italic;
    margin: 1rem 0;
}

.error-message {
    color: #dc3545;
    padding: 0.5rem;
    margin: 0.5rem 0;
    background: #ffe6e6;
    border-radius: 4px;
}

.analysis-section,
.elements-section {
    margin: 1rem 0;
}

.analysis-section h4,
.elements-section h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.visualization-canvas {
    max-width: 100%;
    margin-top: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.visualization-canvas:not([width]) {
    min-height: 200px;
}

/* Visualization styles */
.visualization-canvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

#elementTooltip {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    pointer-events: none;
    z-index: 1000;
    max-width: 300px;
    font-size: 14px;
}

.analysis-section pre,
.elements-section pre {
    background: var(--background-light);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.5;
}

.info-section pre {
    margin: 0;
    padding: 0.5rem;
    background: var(--background-light);
    border-radius: 4px;
}

.progress-indicator {
    font-family: monospace;
    white-space: pre-wrap;
    padding: 0.5rem;
    background: var(--background-light);
    border-radius: 4px;
    margin: 0.5rem 0;
}