/**
 * Authentication UI styles
 * Login modal, logged-in state, comment forms
 */

/* Login button in header */
#login-btn,
#logout-btn {
  padding: 0.5rem 1rem;
  background: var(--gold);
  color: #0a0a0a;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
  vertical-align: middle;
  display: inline-block;
}

#login-btn:hover,
#logout-btn:hover {
  background: #b8941f;
}

#logout-btn {
  display: none;
}

#user-display {
  display: none;
  margin-right: 1rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* Login modal */
#login-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.login-modal-content {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  width: 90%;
  position: relative;
  border: 1px solid var(--border-color, #333);
}

.login-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.login-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--gold);
}

#modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-close:hover {
  color: var(--gold);
}

.login-modal-body p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

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

#login-email {
  padding: 0.75rem;
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  font-size: 1rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

#login-email:focus {
  outline: none;
  border-color: var(--gold);
}

#login-submit {
  padding: 0.75rem;
  background: var(--gold);
  color: #0a0a0a;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

#login-submit:hover:not(:disabled) {
  background: #b8941f;
}

#login-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-message {
  padding: 0.75rem;
  border-radius: 4px;
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
}

.login-message.success {
  background: rgba(82, 183, 136, 0.2);
  color: #52B788;
  border: 1px solid #52B788;
}

.login-message.error {
  background: rgba(231, 111, 81, 0.2);
  color: #E76F51;
  border: 1px solid #E76F51;
}

/* Comment section styles */
.comment-login-prompt {
  display: none;
  padding: 2rem;
  text-align: center;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin: 2rem 0;
}

.comment-login-prompt p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.comment-form {
  display: none;
  margin: 2rem 0;
}

.comment-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-secondary);
  color: var(--text-primary);
  resize: vertical;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.comment-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1rem;
}

.comment-form button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.comment-form .btn-submit {
  background: var(--gold);
  color: #0a0a0a;
}

.comment-form .btn-submit:hover:not(:disabled) {
  background: #b8941f;
}

.comment-form .btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.comment-form .btn-cancel {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color, #333);
}

.comment-form .btn-cancel:hover {
  background: var(--bg-secondary);
}

/* Comments list */
.comments-list {
  margin-top: 2rem;
}

.comment {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 3px solid var(--border-color, #333);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.comment-author {
  font-weight: 600;
  color: var(--gold);
  font-size: 0.9rem;
}

.comment-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.comment-body {
  color: var(--text-primary);
  line-height: 1.6;
}

.comment-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 1rem;
}

.comment-action {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.comment-action:hover {
  color: var(--gold);
}

.comment-edited {
  font-style: italic;
  opacity: 0.7;
  font-size: 0.75rem;
}

.comment-reply {
  margin-left: 2rem;
  margin-top: 1rem;
}

/* Comment edit form */
.comment-edit-form {
  margin: 1rem 0;
}

.comment-edit-textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1px solid var(--gold);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-secondary);
  color: var(--text-primary);
  resize: vertical;
  margin-bottom: 0.5rem;
}

.comment-edit-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(196, 162, 101, 0.2);
}

.comment-edit-actions {
  display: flex;
  gap: 0.5rem;
}

.comment-edit-save,
.comment-edit-cancel {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.comment-edit-save {
  background: var(--gold);
  color: #0a0a0a;
}

.comment-edit-save:hover:not(:disabled) {
  background: #b8941f;
}

.comment-edit-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.comment-edit-cancel {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color, #333);
}

.comment-edit-cancel:hover {
  background: var(--bg-secondary);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .login-modal-content {
    padding: 1.5rem;
  }
  
  .comment-reply {
    margin-left: 1rem;
  }
}
