/* Import Tailwind CSS */
@import url('https://cdn.tailwindcss.com/3.3.0');

/* Import Google Material Icons */
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

/* Custom styles */
:root {
  --primary-blue: #1e40af;
  --primary-blue-light: #3b82f6;
  --sidebar-width: 256px;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Logo styles */
.logo {
  max-height: 48px;
  height: 48px;
  max-width: 144px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Logo for navbar - smaller */
.logo-navbar,
img.logo-navbar {
  max-height: 24px !important;
  height: 24px !important;
  max-width: 60px !important;
  width: auto !important;
  object-fit: contain !important;
  display: block !important;
}

/* Alternative logo for light backgrounds */
.logo-light {
  max-height: 80px;
  height: 80px;
  max-width: 200px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Sidebar styles */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 10;
}

.sidebar-item {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: 0.75rem 1rem !important;
  color: rgba(255, 255, 255, 0.8) !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  border-radius: 0.5rem !important;
  margin: 0 0.25rem 0.25rem 0.25rem !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
}

.sidebar-item:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: white !important;
}

.sidebar-item.active {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

.sidebar-item .material-icons {
  @apply flex items-center justify-center leading-none;
  vertical-align: middle;
  line-height: 1;
}

.sidebar-item span:not(.material-icons) {
  @apply leading-none;
  line-height: 1;
}

/* Main content area */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background-color: #f8fafc;
}

/* File upload area */
.upload-area {
  @apply border-2 border-dashed border-gray-300 rounded-lg p-8 text-center hover:border-blue-400 transition-colors cursor-pointer;
}

.upload-area.dragover {
  @apply border-blue-500 bg-blue-50;
}

/* Schema form styles */
.schema-field {
  @apply bg-white rounded-lg border border-gray-200 p-4 shadow-sm transition-all;
}

.schema-field:hover {
  @apply shadow-md;
}

/* AI confidence indicators */
.schema-field.border-green-300 {
  @apply border-green-300 bg-green-50;
}

.schema-field.border-yellow-300 {
  @apply border-yellow-300 bg-yellow-50;
}

/* Schema action buttons */
button[data-suggest-schema] {
  @apply transition-all duration-200;
}

button[data-suggest-schema]:hover {
  @apply transform scale-105;
}

button[data-suggest-schema]:disabled {
  @apply opacity-75 cursor-not-allowed transform-none;
}

/* Results tabs */
.tab-button {
  @apply px-4 py-2 border-b-2 border-transparent text-gray-600 hover:text-gray-900 hover:border-gray-300 transition-colors;
}

.tab-button.active {
  @apply border-blue-500 text-blue-600;
}

/* Code preview */
.code-preview {
  @apply bg-gray-900 text-green-400 p-4 rounded-lg font-mono text-sm overflow-x-auto;
}

/* Document preview styles */
.preview-content iframe {
  border: none;
  background: white;
}

.preview-content img {
  transition: transform 0.2s ease;
  cursor: zoom-in;
}

.preview-content img:hover {
  transform: scale(1.02);
}

.preview-content img.zoomed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  cursor: zoom-out;
  transform: none;
}

/* Fullscreen iframe styles */
.preview-content iframe:fullscreen {
  width: 100vw;
  height: 100vh;
  background: white;
}

.preview-content iframe:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  background: white;
}

.preview-content iframe:-moz-full-screen {
  width: 100vw;
  height: 100vh;
  background: white;
}

.preview-content iframe:-ms-fullscreen {
  width: 100vw;
  height: 100vh;
  background: white;
}

.preview-controls {
  @apply absolute top-2 right-2 flex gap-2;
}

.preview-control-btn {
  @apply bg-white/90 hover:bg-white text-gray-700 p-2 rounded-lg shadow-md transition-colors;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Loading animation */
.loading {
  @apply animate-pulse;
}

/* Responsive design */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
}