/* 
 * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
 * See LICENSE in the project root for license information.
 */

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Header */
.app-header {
  padding: 20px;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
}

.app-header h1 {
  margin: 0;
  font-weight: 600;
}

/* Main Content */
.app-main {
  padding: 20px;
  max-width: 100%;
}

/* Section */
.section {
  margin-bottom: 20px;
}

.section-title {
  margin: 0 0 8px 0;
  font-weight: 600;
  color: #323130;
}

.section-description {
  margin: 0 0 16px 0;
  color: #605e5c;
}

/* Login Illustration */
.login-illustration {
  text-align: center;
  margin-bottom: 20px;
}

.login-illustration img {
  max-width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
}

/* Form Groups */
.form-group {
  margin-bottom: 16px;
}

.ms-Label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: #323130;
}

.ms-TextField-field {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #8a8886;
  border-radius: 2px;
  font-size: 14px;
  font-family:
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    "Roboto",
    sans-serif;
  box-sizing: border-box;
}

.ms-TextField-field:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

.field-hint {
  margin: 4px 0 0 0;
  color: #605e5c;
  font-style: italic;
}

/* Select Dropdown */
.ms-Dropdown-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #8a8886;
  border-radius: 2px;
  font-size: 14px;
  font-family:
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    "Roboto",
    sans-serif;
  box-sizing: border-box;
  background-color: white;
  cursor: pointer;
}

.ms-Dropdown-select:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

/* Textarea */
.textarea-field {
  resize: vertical;
  min-height: 60px;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: center;
}

.ms-Checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.ms-Checkbox-input {
  margin-right: 8px;
  cursor: pointer;
}

.ms-Checkbox-label {
  font-weight: 400;
  color: #323130;
  cursor: pointer;
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* Buttons */
.ms-Button {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ms-Button:hover {
  opacity: 0.9;
}

.ms-Button:active {
  transform: scale(0.98);
}

.ms-Button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Button Variants */
.btn-login {
  background: #38a169;
  color: white;
  margin-top: 8px;
}

.btn-login:hover {
  background: #2f855a;
}

.btn-sign {
  background: #3b82f6;
  color: white;
}

.btn-sign:hover {
  background: #2563eb;
}

.btn-finalize {
  background: #10b981;
  color: white;
}

.btn-finalize:hover {
  background: #059669;
}

.btn-logout {
  background: #dc3545;
  color: white;
}

.btn-logout:hover {
  background: #c82333;
}

/* Action Buttons Container */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* User Info */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f3f2f1;
  border-radius: 4px;
  margin-bottom: 16px;
}

.user-name {
  margin: 0;
  font-weight: 600;
  color: #323130;
}

.user-username {
  margin: 0;
  color: #605e5c;
}

/* Document Info */
.document-info {
  padding: 16px;
  background-color: #f3f2f1;
  border-radius: 4px;
  margin-bottom: 20px;
}

.document-info h3 {
  margin: 0 0 12px 0;
  font-weight: 600;
  color: #323130;
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-label {
  font-weight: 600;
  color: #605e5c;
}

.info-value {
  color: #323130;
  font-family: "Courier New", monospace;
}

.btn-create {
  background: #0078d4;
  color: white;
  margin-top: 8px;
}

.btn-create:hover {
  background: #106ebe;
}

.status-signed {
  color: #10b981;
  font-weight: 600;
}

/* Messages */
.error-message {
  padding: 12px;
  margin-top: 12px;
  background: #fde7e9;
  border-left: 4px solid #dc3545;
  border-radius: 2px;
  color: #721c24;
  font-size: 13px;
}

.success-message {
  padding: 12px;
  margin-top: 12px;
  background: #d4edda;
  border-left: 4px solid #10b981;
  border-radius: 2px;
  color: #155724;
  font-size: 13px;
}

/* Document Status */
.document-status {
  margin-top: 20px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e1e4e8;
}

.document-status h3 {
  margin: 0 0 12px 0;
  color: #323130;
}

.status-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #e1e4e8;
}

.status-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.status-label {
  font-weight: 600;
  color: #605e5c;
}

.status-value {
  color: #323130;
}

.code-value {
  font-family: "Courier New", monospace;
  background: #fff;
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid #e1e4e8;
}

/* Loading */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 16px;
}

.ms-Spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f2f1;
  border-top-color: #0078d4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Icons */
.ms-Icon {
  font-family: "FabricMDL2Icons";
  speak: none;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
}

.ms-Icon--Contact:before {
  content: "\E77B";
}
.ms-Icon--Edit:before {
  content: "\E70F";
}
.ms-Icon--CheckMark:before {
  content: "\E73E";
}
.ms-Icon--SignOut:before {
  content: "\E7E8";
}
/* Dashboard */
.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px;
}

.dashboard-card {
  background: white;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-color: #0078d4;
}

.card-icon {
  font-size: 24px;
  color: #0078d4;
  background: #f3f9fd;
  padding: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-content {
  flex: 1;
}

.card-title {
  font-weight: 600;
  font-size: 16px;
  color: #323130;
  margin: 0 0 4px 0;
}

.card-description {
  font-size: 13px;
  color: #605e5c;
  margin: 0;
}

/* My Documents List */
/* Compact Document List */
.documents-list {
  display: flex;
  flex-direction: column;
  gap: 0; /* No gaps, continuous list */
  border: 1px solid #e1e4e8; /* Outer border */
  border-bottom: none; /* Last item will provide bottom border */
}

/* Base List Item Style */
.document-card-item {
  background: white;
  border: none;
  border-bottom: 1px solid #e1e4e8;
  border-radius: 0; /* No radius */
  padding: 8px 12px; /* Compact padding */
  display: flex;
  align-items: center; /* Vertically center everything */
  gap: 12px;
  cursor: pointer;
  transition: background-color 0.1s;
  position: relative;
  box-shadow: none; /* No shadow */
}

.document-card-item:hover {
  background-color: #f3f2f1; /* Native-like hover */
  transform: none; /* No movement */
  box-shadow: none;
}

/* Remove the left colored bar, we'll use the icon color */
.document-card-item::before {
  display: none;
}

/* Left Icon Container */
.doc-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: #f3f2f1;
  border-radius: 0; /* Square or maybe slightly rounded? User said no radius, assume purely square or circle? keeping square for purely 'no radius' feel or maybe slight soft? I will keep it simple. */
  flex-shrink: 0;
}

.doc-info-col {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px; /* Very tight gap */
  min-width: 0; /* Allow truncation */
}

.doc-ref {
  font-weight: 600;
  color: #201f1e;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-details-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #605e5c;
  flex-wrap: wrap; /* Safety for small screens */
}

.doc-separator {
  color: #c8c6c4;
}

.status-text {
  font-weight: 600;
}

.status-text.finalized {
  color: #10b981;
}

.status-text.draft {
  color: #d97706; /* Dark orange */
}

.code-pill {
  font-family: "Consolas", "Courier New", monospace;
  background-color: #f3f2f1;
  padding: 0 4px;
  font-size: 11px;
  color: #323130;
  border: 1px solid #edebe9;
}

.status-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.finalized {
  background-color: #d4edda;
  color: #155724;
}

.status-badge.draft {
  background-color: #fff3cd;
  color: #856404;
}

.btn-icon {
  background: none;
  border: none;
  color: #605e5c;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.btn-icon:hover {
  background-color: #edebe9;
  color: #0078d4;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #605e5c;
}

.header-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.btn-back {
  background: none;
  border: none;
  color: #0078d4;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-back:hover {
  text-decoration: underline;
}
