/* Card Component */
.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card:hover {
  border-color: var(--purple-600);
  box-shadow: 0 4px 12px var(--purple-shadow);
}

.card-name {
  font-size: 1rem;
  font-weight: 500;
  color: #1d1d1f;
  word-break: break-word;
  text-align: center;
}

.card-checkbox {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
  display: none;
}

.card-checkbox.visible {
  display: block;
}

.card.selected {
  border-color: var(--purple-600);
  background: var(--purple-50);
}

/* Side Panel */
.side-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: white;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.side-panel.open {
  transform: translateX(0);
}

.side-panel-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.side-panel-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1d1d1f;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  padding: 0.25rem;
}

.close-btn:hover {
  color: #1d1d1f;
}

.side-panel-menu {
  flex: 1;
  padding: 1rem 0;
}

.menu-item {
  padding: 1rem 1.5rem;
  color: #1d1d1f;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

.menu-item:hover {
  background: #f9fafb;
}

.menu-item.disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

.menu-item.disabled:hover {
  background: transparent;
}

.menu-item.signout {
  color: #ef4444;
}

.menu-item.signout:hover {
  background: #fef2f2;
}

.side-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  z-index: 999;
  display: none;
}

.side-panel-overlay.visible {
  display: block;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  display: none;
}

.modal-overlay.visible {
  display: flex;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
}

.modal-close-btn:hover {
  background: #f3f4f6;
}

.modal-close-btn img {
  width: 20px;
  height: 20px;
  opacity: 0.6;
}

.modal-close-btn:hover img {
  opacity: 1;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 1.5rem;
}

.modal-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.modal-input:focus {
  outline: none;
  border-color: var(--purple-600);
}

.modal-error {
  color: #ef4444;
  font-size: 0.75rem;
  margin-bottom: 1rem;
  display: none;
}

.modal-error.visible {
  display: block;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.modal-btn-primary {
  background: var(--purple-600);
  color: white;
}

.modal-btn-primary:hover {
  background: var(--purple-700);
}

.modal-btn-secondary {
  background: white;
  color: #1d1d1f;
  border: 1px solid #e5e7eb;
}

.modal-btn-secondary:hover {
  background: #f9fafb;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1d1d1f;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Login Page Specific */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-login-bg);
}

.login-card {
  background: white;
  border-radius: 12px;
  padding: 2.5rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.login-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1d1d1f;
  margin-bottom: 2rem;
  text-align: center;
  background: var(--gradient-login-title);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.form-input {
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--purple-600);
}

.form-error {
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: 0.5rem;
  display: none;
}

.form-error.visible {
  display: block;
}

.form-hint {
  color: #6b7280;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  line-height: 1.4;
}

.login-btn {
  background: var(--purple-600);
  color: white;
  border: none;
  padding: 0.875rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

.login-btn:hover {
  background: var(--purple-700);
}

.login-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

/* Selection Mode */
.selection-actions {
  display: none;
  gap: 0.75rem;
}

.selection-actions.visible {
  display: flex;
}

.selection-btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.selection-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rename-btn {
  background: white;
  color: #1d1d1f;
  border: 1px solid #e5e7eb;
}

.rename-btn:hover:not(:disabled) {
  background: #f9fafb;
}

.duplicate-btn {
  background: white;
  color: #1d1d1f;
  border: 1px solid #e5e7eb;
}

.duplicate-btn:hover:not(:disabled) {
  background: #f9fafb;
}

.delete-btn {
  background: #ef4444;
  color: white;
}

.delete-btn:hover:not(:disabled) {
  background: #dc2626;
}

.cancel-btn {
  background: white;
  color: #1d1d1f;
  border: 1px solid #e5e7eb;
}

.cancel-btn:hover {
  background: #f9fafb;
}

/* Skeleton Loading */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.skeleton-card {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
}

.skeleton-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Updating Card - applies shimmer to regular cards */
.card.updating {
  position: relative;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.7;
}

.card.updating::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: shimmer 1.5s infinite;
  z-index: 1;
}

/* Account Modal */
.account-modal {
  max-width: 450px;
}

.account-info {
  margin-bottom: 2rem;
}

.account-info-item {
  padding: 1rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.account-info-item:last-child {
  border-bottom: none;
}

.account-info-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.account-info-value {
  font-size: 1rem;
  color: #1d1d1f;
  word-break: break-word;
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.account-action-btn {
  width: 100%;
  padding: 0.875rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: white;
  color: #1d1d1f;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.account-action-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.account-action-btn.danger {
  color: #ef4444;
  border-color: #fecaca;
}

.account-action-btn.danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* Delete Account Modal */
.delete-modal {
  max-width: 450px;
}

.delete-title {
  color: #ef4444;
}

.delete-warning {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: #991b1b;
  line-height: 1.5;
}

.delete-warning strong {
  display: block;
  margin-bottom: 0.5rem;
  color: #dc2626;
}

.modal-btn-danger {
  background: #ef4444;
  color: white;
}

.modal-btn-danger:hover {
  background: #dc2626;
}

.modal-btn-danger:disabled {
  background: #fca5a5;
  cursor: not-allowed;
}
