/* Copyright 2012 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* Upload Screen Container */
#uploadScreenContainer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--body-bg-color);
  z-index: 10001;
  overflow-y: auto;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

#uploadScreenContainer::-webkit-scrollbar {
  width: 8px;
}

#uploadScreenContainer::-webkit-scrollbar-track {
  background: var(--scrollbar-bg-color, rgba(0, 0, 0, 0.05));
}

#uploadScreenContainer::-webkit-scrollbar-thumb {
  background: var(--scrollbar-color, rgba(0, 0, 0, 0.2));
  border-radius: 4px;
}

/* Main Screen */
.pdf-upload-screen {
  width: 100%;
  max-width: 900px;
  margin: auto;
}

/* Header with Logo and Title */
.pdf-upload-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
  padding-left: 0;
}

.pdf-upload-logo {
  width: 60px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.pdf-upload-title-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pdf-upload-title {
  margin: 0;
  font-size: 28px;
  color: var(--main-color);
  font-weight: 700;
  letter-spacing: -0.5px;
}

.pdf-upload-tagline {
  margin: 8px 0 0 0;
  font-size: 14px;
  color: var(--main-color);
  opacity: 0.7;
  font-weight: 400;
  letter-spacing: 0.3px;
}

/* Drop Zone */
.pdf-upload-zone {
  background: var(--field-bg-color);
  border: 2px solid var(--field-border-color);
  border-radius: 8px;
  padding: 60px 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--main-color) 10%, transparent);
  margin-bottom: 40px;
}

.pdf-upload-zone:hover {
  border-color: color-mix(in srgb, var(--field-border-color) 140%, transparent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--main-color) 15%, transparent);
  transform: translateY(-2px);
}

.pdf-upload-zone-active {
  border-color: color-mix(in srgb, var(--field-border-color) 160%, transparent);
  background: color-mix(in srgb, var(--field-bg-color) 95%, var(--toolbar-icon-bg-color) 5%);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--main-color) 20%, transparent);
  transform: scale(1.01);
}

/* Drop Zone Content */
.pdf-upload-zone-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pdf-upload-zone-icon {
  font-size: 48px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--field-border-color) 50%, transparent);
  border-radius: 8px;
  color: color-mix(in srgb, var(--main-color) 70%, transparent);
}

.pdf-upload-heading {
  margin: 0;
  font-size: 20px;
  color: var(--main-color);
  font-weight: 600;
}

.pdf-upload-zone-subtext {
  margin: 0;
  font-size: 14px;
  color: color-mix(in srgb, var(--main-color) 70%, transparent);
}

/* History Section */
.pdf-upload-history {
  background: var(--field-bg-color);
  border-radius: 8px;
  border: 1px solid var(--field-border-color);
  padding: 24px;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--main-color) 10%, transparent);
}

.pdf-upload-history-title {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: var(--main-color);
  font-weight: 600;
}

/* History List */
.pdf-upload-history-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

/* History Item - List Style */
.pdf-upload-history-item {
  background: transparent;
  border: 1px solid var(--field-border-color);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.pdf-upload-history-item:hover {
  border-color: color-mix(in srgb, var(--field-border-color) 140%, transparent);
  background: color-mix(in srgb, var(--field-bg-color) 50%, var(--toolbar-icon-bg-color) 5%);
  transform: translateX(4px);
}

.pdf-upload-history-item-icon {
  font-size: 28px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--field-border-color) 50%, transparent);
  border-radius: 6px;
  color: color-mix(in srgb, var(--main-color) 70%, transparent);
  flex-shrink: 0;
}

.pdf-upload-history-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pdf-upload-history-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--main-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-upload-history-item-meta {
  font-size: 12px;
  color: color-mix(in srgb, var(--main-color) 60%, transparent);
  display: flex;
  gap: 12px;
}

/* Clear History Button */
.pdf-upload-clear-history-button {
  width: 100%;
  background: var(--dialog-button-bg-color);
  color: var(--field-color);
  border: 1px solid var(--field-border-color);
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pdf-upload-clear-history-button:hover {
  background: var(--dialog-button-hover-bg-color);
  border-color: color-mix(in srgb, var(--field-border-color) 120%, transparent);
}

.pdf-upload-clear-history-button:active {
  transform: scale(0.98);
}

.pdf-upload-clear-history-button:focus {
  outline: 2px solid color-mix(in srgb, var(--field-border-color) 160%, transparent);
  outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  #uploadScreenContainer {
    padding: 16px;
  }

  .pdf-upload-header {
    margin-bottom: 32px;
  }

  .pdf-upload-logo {
    width: 50px;
    height: 54px;
  }

  .pdf-upload-title {
    font-size: 24px;
  }

  .pdf-upload-zone {
    padding: 40px 20px;
    margin-bottom: 32px;
  }

  .pdf-upload-heading {
    font-size: 18px;
  }

  .pdf-upload-zone-icon {
    font-size: 40px;
    width: 40px;
    height: 40px;
  }


  .pdf-upload-history {
    padding: 16px;
  }

  .pdf-upload-history-item {
    padding: 10px 12px;
  }

  .pdf-upload-history-item-icon {
    font-size: 24px;
    width: 28px;
    height: 28px;
  }

  .pdf-upload-history-item-name {
    font-size: 13px;
  }

  .pdf-upload-history-item-meta {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  #uploadScreenContainer {
    padding: 12px;
  }

  .pdf-upload-header {
    margin-bottom: 24px;
  }

  .pdf-upload-logo {
    width: 45px;
    height: 48px;
  }

  .pdf-upload-title {
    font-size: 20px;
  }

  .pdf-upload-zone {
    padding: 30px 15px;
    margin-bottom: 24px;
  }

  .pdf-upload-heading {
    font-size: 16px;
  }

  .pdf-upload-zone-icon {
    font-size: 32px;
    width: 32px;
    height: 32px;
  }

  .pdf-upload-zone-subtext {
    font-size: 13px;
  }


  .pdf-upload-history-item {
    padding: 10px;
  }

  .pdf-upload-history-item-icon {
    font-size: 20px;
    width: 24px;
    height: 24px;
  }

  .pdf-upload-history-item-name {
    font-size: 12px;
  }

  .pdf-upload-history-item-meta {
    font-size: 10px;
    gap: 8px;
  }
}
