/**
 * Admin styles for the wedding site
 *
 * This file contains all the styles for the admin interface
 */

:root {
  --accent-color: #4caf50;
  --error-color: #e74c3c;
  --warning-color: #f39c12;
  --success-color: #2ecc71;
  /* Assuming --primary-color and --secondary-color are defined elsewhere,
     or you can define them here if they are missing.
     For example:
     --primary-color: #3498db;
     --secondary-color: #2980b9;
  */
}

body {
  font-family: "Lato", sans-serif;
  background-color: #f5f5f5;
  margin: 0;
  padding: 0;
}

/* Admin Header */
.admin-header {
  background-color: var(--primary-color);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  margin: 0;
  font-size: 24px;
  font-family: "Playfair Display", serif;
}

.admin-nav {
  display: flex;
  gap: 20px;
}

.admin-nav a {
  color: white;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 4px;
}

.admin-nav a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.admin-nav a.logout {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Admin Container */
.admin-container {
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
}

/* Admin Panel */
.admin-panel {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.admin-panel h2 {
  color: var(--primary-color);
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.admin-panel p {
  margin-bottom: 20px;
}

/* Status Indicators */
.admin-panel .status {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 4px;
  font-weight: bold;
}

.admin-panel .status.success {
  background-color: #d4edda;
  color: #155724;
}

.admin-panel .status.error {
  background-color: #f8d7da;
  color: #721c24;
}

/* Admin Buttons */
.admin-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.admin-button {
  display: inline-block;
  padding: 10px 15px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

.admin-button:hover {
  background-color: var(--secondary-color);
}

.admin-button.secondary {
  background-color: #6c757d;
}

.admin-button.secondary:hover {
  background-color: #5a6268;
}

/* Login Form */
.admin-login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.admin-login-header {
  text-align: center;
  margin-bottom: 20px;
}

.admin-form {
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
}

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

.form-submit {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
}

.form-submit:hover {
  background-color: var(--secondary-color);
}

/* Messages */
.error-message {
  color: var(--error-color);
  margin-bottom: 15px;
  text-align: center;
  padding: 10px;
  background-color: #fde8e8;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
}

.info-message {
  color: #3498db;
  margin-bottom: 15px;
  text-align: center;
  padding: 10px;
  background-color: #e3f2fd;
  border: 1px solid #b3e5fc;
  border-radius: 4px;
}

.message {
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 20px;
  text-align: center;
}

.message.error {
  background-color: #fde8e8;
  color: var(--error-color);
  border: 1px solid #f5c6cb;
}

.message.warning {
  background-color: #fff3cd;
  color: var(--warning-color);
  border: 1px solid #ffeeba;
}

.message.success {
  background-color: #d4edda;
  color: var(--success-color);
  border: 1px solid #c3e6cb;
}

/* Setup Form */
.setup-container {
  max-width: 500px;
  margin: 50px auto;
  padding: 30px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.setup-header {
  text-align: center;
  margin-bottom: 30px;
}

.setup-header h1 {
  color: var(--primary-color);
  font-family: "Playfair Display", serif;
  margin-bottom: 10px;
}

.setup-form {
  display: flex;
  flex-direction: column;
}

.login-link {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background-color: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
}

.login-link:hover {
  background-color: #3d8b40;
}

/* Filter Form */
.filter-form {
  margin-bottom: 20px;
  padding: 15px;
  background-color: white;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group label {
  font-weight: bold;
  color: #333;
}

.filter-group select,
.filter-group input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
  min-width: 200px;
  box-sizing: border-box;
  height: 45px; /* Consistent height for all form elements */
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.filter-buttons {
  display: flex;
  gap: 10px;
  align-items: center; /* Align the buttons themselves in the middle */
}

.filter-button {
  background-color: var(--primary-color);
  color: white;
  border: 2px solid transparent; /* Consistent border to prevent shift */
  padding: 0 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  min-width: 100px;
  text-align: center;
  display: inline-block; /* Keep as inline-block */
  box-sizing: border-box; /* Crucial for consistent sizing */
  font-size: 16px;
  height: 45px; /* Fixed total height */
  line-height: 41px; /* (height - 2*border-width) to vertically center text */
  vertical-align: middle; /* Explicitly align vertically */
}

.filter-button:hover {
  border-color: var(--primary-color);
  background-color: white;
  color: var(--primary-color);
}

.reset-button {
  border: 2px solid var(--primary-color);
  background-color: white;
  color: var(--primary-color);
}

.reset-button:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: transparent;
}

.export-button {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 20px;
  min-width: 120px;
  text-align: center;
  font-size: 16px;
}

.export-button:hover {
  background-color: #3d8b40;
}

/* Tables */
.submissions-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.submissions-table th,
.submissions-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.submissions-table th {
  background-color: #f8f9fa;
  color: #333;
  font-weight: bold;
  position: relative;
}

.submissions-table th a {
  color: #333;
  text-decoration: none;
  display: block;
}

.submissions-table th a:hover {
  color: var(--primary-color);
}

.sort-indicator {
  margin-left: 5px;
}

.submissions-table tr:hover {
  background-color: #f9f9f9;
}

.message-cell {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all 0.3s;
}

.message-cell.expanded {
  white-space: normal;
  overflow: visible;
  background-color: #f8f9fa;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: var(--primary-color);
  transition: all 0.3s;
}

.pagination a:hover {
  background-color: #f5f5f5;
  border-color: var(--primary-color);
}

.pagination .current {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination .disabled {
  color: #aaa;
  cursor: not-allowed;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 30px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Logout Button */
.logout-button {
  background-color: transparent;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: normal;
  font-family: inherit;
  font-size: inherit;
}

.logout-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Delete Link */
.delete-link {
  color: var(--error-color);
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background-color: transparent;
}

.delete-link:hover {
  color: #c0392b;
  text-decoration: underline;
}

/* Form in table cell */
.submissions-table td form {
  display: flex;
  align-items: center;
  height: 100%;
  margin: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .admin-nav {
    flex-wrap: wrap;
  }

  .submissions-table {
    display: block;
    overflow-x: auto;
  }

  .admin-buttons {
    flex-direction: column;
  }
}
