/* File: assets/css/portal.css */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #333;
  background: #f9fafb;
}

/* Authentication Pages */
.sdp-container {
  width: 100%;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.sdp-auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  min-height: 100vh;
}

.sdp-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sdp-header {
  text-align: center;
  margin-bottom: 30px;
}

.sdp-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.sdp-header p {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

/* Forms */
.sdp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sdp-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sdp-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sdp-form-group input {
  padding: 11px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: #f9fafb;
}

.sdp-form-group input:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.sdp-form-group input:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.sdp-otp-input {
  text-align: center;
  font-size: 32px !important;
  letter-spacing: 12px;
  font-family: 'Courier New', monospace !important;
  font-weight: 700 !important;
  tracking-widest: true;
}

/* Buttons */
.sdp-button {
  padding: 11px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.sdp-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sdp-button-primary,
.sdp-button {
  background: linear-gradient(135deg, #667eea 0%, #5568d3 100%);
  color: white;
}

.sdp-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #5568d3 0%, #4557c5 100%);
}

.sdp-button-primary {
  width: 100%;
}

.sdp-button-secondary {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  width: 100%;
}

.sdp-button-secondary:hover:not(:disabled) {
  background: #f3f4f6;
}

.sdp-button-success {
  background: #10b981;
  color: white;
}

.sdp-button-success:hover:not(:disabled) {
  background: #059669;
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.4);
}

.sdp-button-link {
  background: none;
  color: #667eea;
  padding: 10px 0;
  text-decoration: none;
  border: none;
  width: 100%;
}

.sdp-button-link:hover {
  color: #5568d3;
  text-decoration: underline;
}

.sdp-button-logout {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  padding: 8px 14px;
  font-size: 12px;
  width: auto;
}

.sdp-button-logout:hover {
  background: #e5e7eb;
  box-shadow: none;
  transform: none;
}

/* Alerts */
.sdp-error {
  padding: 12px 14px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  font-size: 13px;
  font-weight: 500;
  animation: slideDown 0.3s ease-out;
}

.sdp-success {
  padding: 12px 14px;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #166534;
  font-size: 13px;
  font-weight: 500;
  animation: slideDown 0.3s ease-out;
}

.sdp-info {
  padding: 12px 14px;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1e40af;
  font-size: 12px;
  text-align: center;
  font-weight: 500;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Portal Layout */
.sdp-portal {
  min-height: 100vh;
  background: #f9fafb;
}

.sdp-header-bar {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.sdp-header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.sdp-header-content h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
}

.sdp-user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sdp-user-email {
  margin: 0;
  font-weight: 600;
  color: #1f2937;
  font-size: 14px;
}

.sdp-session-time {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #9ca3af;
}

.sdp-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

/* Sidebar */
.sdp-sidebar {
  display: flex;
  flex-direction: column;
}

.sdp-folders {
  background: white;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 80px;
}

.sdp-folders h2 {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sdp-folder-btn {
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  color: #4b5563;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  margin-bottom: 6px;
}

.sdp-folder-btn:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.sdp-folder-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #5568d3 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sdp-folder-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.sdp-folder-name {
  flex: 1;
  font-weight: 500;
}

/* Main Content */
.sdp-main {
  display: flex;
  flex-direction: column;
}

.sdp-documents h2 {
  margin: 0 0 20px 0;
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
}

.sdp-empty {
  text-align: center;
  padding: 60px 40px;
  color: #9ca3af;
  font-size: 15px;
  background: white;
  border-radius: 10px;
  border: 2px dashed #e5e7eb;
}

/* Document Cards */
.sdp-document-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.sdp-document-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
  transform: translateY(-2px);
}

.sdp-agreement-notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.sdp-agreement-notice label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: #92400e;
  margin: 0;
}

.sdp-agreement-notice input[type="checkbox"] {
  margin-top: 3px;
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #667eea;
}

.sdp-document-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
}

.sdp-document-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.sdp-document-size {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #9ca3af;
}

.sdp-badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sdp-badge.view-only {
  background: #fee2e2;
  color: #991b1b;
}

.sdp-badge.downloadable {
  background: #dcfce7;
  color: #166534;
}

.sdp-badge.editable {
  background: #dbeafe;
  color: #1e40af;
}

.sdp-document-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sdp-document-actions .sdp-button {
  padding: 8px 12px;
  font-size: 13px;
  flex: 1;
  min-width: 120px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .sdp-content {
    grid-template-columns: 1fr;
  }

  .sdp-folders {
    position: static;
  }

  .sdp-folder-btn {
    flex: 1;
  }

  .sdp-folders {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .sdp-folder-btn {
    margin-bottom: 0;
  }
}

@media (max-width: 768px) {
  .sdp-card {
    padding: 30px 20px;
  }

  .sdp-header-content {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }

  .sdp-user-info {
    width: 100%;
    justify-content: space-between;
  }

  .sdp-content {
    padding: 16px;
    gap: 16px;
  }

  .sdp-document-header {
    flex-direction: column;
  }

  .sdp-document-card {
    padding: 16px;
  }

  .sdp-document-actions {
    flex-direction: column;
  }

  .sdp-document-actions .sdp-button {
    width: 100%;
    min-width: unset;
    flex: none;
  }

  .sdp-button-primary {
    width: 100%;
  }

  .sdp-header h1 {
    font-size: 22px;
  }

  .sdp-folders {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .sdp-card {
    padding: 24px 16px;
    border-radius: 8px;
  }

  .sdp-header h1 {
    font-size: 20px;
  }

  .sdp-header p {
    font-size: 13px;
  }

  .sdp-form-group input {
    padding: 10px 12px;
    font-size: 13px;
  }

  .sdp-otp-input {
    font-size: 28px !important;
    letter-spacing: 8px;
  }

  .sdp-button {
    padding: 10px 16px;
    font-size: 13px;
  }

  .sdp-content {
    padding: 12px;
  }

  .sdp-folders {
    grid-template-columns: 1fr;
  }

  .sdp-header-content h1 {
    font-size: 18px;
  }

  .sdp-documents h2 {
    font-size: 18px;
  }

  .sdp-document-card {
    padding: 14px;
    margin-bottom: 12px;
  }
}

/* Print Styles */
@media print {
  .sdp-header-bar,
  .sdp-sidebar,
  .sdp-document-actions {
    display: none;
  }

  .sdp-content {
    grid-template-columns: 1fr;
  }
}