/*
 * Single Post Exporter Stylesheet
 *
 * Contains custom styles for the plugin's admin interface.
 *
 * @package Simple_Single_Post_Exporter
 * @since 1.0.0
 */

/* Base styles for the plugin container */
.post-exporter-plugin .wrap {
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.post-exporter-plugin .wrap h1 {
  margin-top: 0;
  font-size: 24px;
  color: #333;
  text-align: center;
}

.post-exporter-plugin .wrap .post-exporter-form {
  margin-top: 20px;
}

.post-exporter-plugin .wrap label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #666;
}

/* Form input elements styling */
.post-exporter-plugin .wrap select,
.post-exporter-plugin .wrap input[type="text"],
.post-exporter-plugin .wrap input[type="email"],
.post-exporter-plugin .wrap input[type="file"],
.post-exporter-plugin .wrap button {
  width: 100%;
  padding: 12px;
  margin: 5px 0 15px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

/* Custom dropdown arrow for select */
.post-exporter-plugin .wrap select {
  background: url('data:image/svg+xml;utf8,<svg fill="grey" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>') no-repeat;
  background-position: right 10px top 50%, 0 0;
  background-size: 24px 24px, 100%;
  max-width: 100%;
  appearance: none; /* Hide default arrow in some browsers */
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Focus styles for text/email inputs */
.post-exporter-plugin .wrap input[type="text"],
.post-exporter-plugin .wrap input[type="email"] {
  transition: border-color 0.3s ease;
}

.post-exporter-plugin .wrap input[type="text"]:focus,
.post-exporter-plugin .wrap input[type="email"]:focus {
  border-color: #0073aa;
  outline: none;
  box-shadow: 0 0 0 1px #0073aa; /* Add a subtle shadow for better focus indication */
}

/* Post list container for search results */
.post-exporter-plugin .wrap .post-list {
  display: none; /* Hidden by default */
  max-height: 300px; /* Max height for scrollable list */
  overflow-y: auto;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  margin-top: 10px;
  background: #f9f9f9;
}

.post-exporter-plugin .wrap .post-list ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.post-exporter-plugin .wrap .post-list li {
  padding: 15px 20px;
  border-bottom: 1px solid #e5e5e5;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-exporter-plugin .wrap .post-list li:last-child {
  border-bottom: none;
}

.post-exporter-plugin .wrap .post-list li:hover {
  background-color: #f0f0f0;
}

/* Style for selected post in the list */
.post-exporter-plugin .wrap .post-list li.selected {
  background-color: #e6f3ff;
  color: #0073aa;
  font-weight: bold;
  padding-left: 18px;
  border-left: 3px solid #0073aa;
}

/* Button styling */
.post-exporter-plugin .wrap button {
  width: 100%;
  padding: 15px 20px;
  margin: 20px 0 10px;
  box-sizing: border-box;
  background-color: #0073aa; /* WordPress primary blue */
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 18px;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.post-exporter-plugin .wrap button:hover {
  background-color: #006799; /* Darker blue on hover */
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* Disabled button styling */
.post-exporter-plugin .wrap button:disabled,
.post-exporter-plugin .wrap button[disabled] {
  background-color: #a0a0a0;
  color: #666;
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
  transform: none;
}

.post-exporter-plugin .wrap button:disabled:hover,
.post-exporter-plugin .wrap button[disabled]:hover {
  background-color: #a0a0a0; /* Keep background same on hover when disabled */
}

/* Search container and close icon */
.post-exporter-plugin .wrap .search-container {
  position: relative;
  width: 100%;
}

.post-exporter-plugin .wrap .search-container input {
  width: 100%;
  padding-right: 30px; /* Space for close icon */
}

.post-exporter-plugin .wrap .close-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 20px;
  line-height: 1; /* Ensure proper vertical alignment */
  color: #999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Show close icon when input is focused or has text */
.post-exporter-plugin .wrap .search-container input:focus + .close-search,
.post-exporter-plugin .wrap .search-container input:not(:placeholder-shown) + .close-search {
  opacity: 1;
}

.post-exporter-plugin .wrap .close-search:hover {
  color: #333;
}

/* Loading spinner */
.loading-spinner {
  display: none; /* Hidden by default */
  text-align: center;
  padding: 10px;
}

.spinner-svg {
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  display: block;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Admin notices (WordPress core classes with custom overrides) */
.notice-success {
  background: #d4edda; /* Light green */
  border-left-color: #28a745; /* Darker green for border */
  border-left-width: 4px;
  padding: 10px 15px;
  margin: 10px 0;
  border-radius: 4px; /* Match form element styling */
}

.notice-success p {
  margin: 0;
  color: #155724; /* Dark green text */
}

/* Responsive Design */
@media (min-width: 768px) {
  .post-exporter-plugin .wrap {
    max-width: 600px; /* Max width on larger screens */
  }

  .post-exporter-plugin .wrap h1 {
    font-size: 28px;
  }
}

@media (max-width: 767px) {
  .post-exporter-plugin .wrap {
    padding: 10px; /* Less padding on smaller screens */
  }

  .post-exporter-plugin .wrap h1 {
    font-size: 20px;
  }

  .post-exporter-plugin .wrap select,
  .post-exporter-plugin .wrap input[type="text"],
  .post-exporter-plugin .wrap input[type="email"],
  .post-exporter-plugin .wrap input[type="file"],
  .post-exporter-plugin .wrap button {
    padding: 10px;
    font-size: 14px;
  }

  .post-exporter-plugin .wrap .post-list li {
    padding: 10px 15px;
  }

  .post-exporter-plugin .wrap .close-search {
    font-size: 18px;
    right: 5px;
  }

  .post-exporter-plugin .wrap button {
    font-size: 16px;
    padding: 10px 15px;
  }
}

@media (max-width: 480px) {
  .post-exporter-plugin .wrap .post-list li {
    font-size: 12px;
  }
}
