/* ==========================================================================
   Portal Page Styling - Clean Minimal Cards (shadcn/ui style)
   ========================================================================== */

.container {
  max-width: 1040px;
  margin: 40px auto;
  padding: 0 24px;
  width: 100%;
}

.portal-header-area {
  margin-bottom: 28px;
}

.portal-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.portal-subtitle {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

.user-email {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--secondary);
  border: 1px solid var(--border);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--ring);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.15);
}

.feature-card:hover::before {
  background: var(--foreground);
}

.feature-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md, 10px);
  background: var(--secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.feature-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feature-name::after {
  content: '→';
  font-size: 14px;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.15s ease-in-out;
  color: var(--muted-foreground);
}

.feature-card:hover .feature-name::after {
  opacity: 1;
  transform: translateX(0);
  color: var(--foreground);
}

.feature-desc {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* Embedded Modal View for Apps */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--background);
  display: flex;
  flex-direction: column;
  animation: modal-appear 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-modal[hidden] {
  display: none !important;
}

@keyframes modal-appear {
  from {
    opacity: 0;
    transform: scale(0.99);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.app-modal-header {
  height: 52px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.app-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-modal-icon {
  font-size: 20px;
}

.app-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.app-modal-url {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-left: 8px;
}

.app-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-modal-action {
  font-size: 12px;
  color: var(--muted-foreground);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--secondary);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.btn-modal-action:hover {
  color: var(--foreground);
  background: var(--accent);
}

.btn-modal-close {
  font-size: 12px;
  font-weight: 600;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-modal-close:hover {
  background: #ef4444;
  color: #fff;
}

.app-modal-body {
  flex: 1;
  width: 100%;
  height: calc(100% - 52px);
  background: var(--background);
  position: relative;
}

.app-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
