/**
 * CSIA Shared CSS Styles
 * 
 * Common styles shared between CSIA Vue components in WordPress
 */

/* Component container */
.csia-component {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  margin: 0;
  padding: 20px;
  color: #333;
}

/* Common form elements */
.csia-component input[type="text"],
.csia-component input[type="email"],
.csia-component input[type="password"],
.csia-component input[type="number"],
.csia-component input[type="tel"],
.csia-component input[type="date"],
.csia-component select,
.csia-component textarea {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s;
}

.csia-component input:focus,
.csia-component select:focus,
.csia-component textarea:focus {
  border-color: #0073aa;
}

/* Buttons */
.csia-component button,
.csia-component .csia-button {
  display: inline-block;
  padding: 8px 16px;
  background-color: #0073aa;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  transition: background-color 0.3s;
}

.csia-component button:hover,
.csia-component .csia-button:hover {
  background-color: #005d8c;
}

.csia-component button:disabled,
.csia-component .csia-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Secondary button */
.csia-component button.secondary,
.csia-component .csia-button.secondary {
  background-color: #f7f7f7;
  color: #333;
  border: 1px solid #ccc;
}

.csia-component button.secondary:hover,
.csia-component .csia-button.secondary:hover {
  background-color: #eee;
}

/* Error and success messages */
.csia-component .csia-error {
  padding: 10px 15px;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  margin-bottom: 15px;
}

.csia-component .csia-success {
  padding: 10px 15px;
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  margin-bottom: 15px;
}

/* Loading indicator */
.csia-component .csia-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.csia-component .csia-loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0073aa;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: csia-spin 2s linear infinite;
}

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

/* Tables */
.csia-component table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.csia-component th,
.csia-component td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.csia-component th {
  background-color: #f7f7f7;
  font-weight: 600;
}

.csia-component tr:hover {
  background-color: #f9f9f9;
}

/* Responsive design */
@media screen and (max-width: 768px) {
  .csia-component {
    padding: 10px;
  }

  .csia-component table,
  .csia-component thead,
  .csia-component tbody,
  .csia-component th,
  .csia-component td,
  .csia-component tr {
    display: block;
  }

  .csia-component thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .csia-component tr {
    border: 1px solid #ddd;
    margin-bottom: 10px;
  }

  .csia-component td {
    border: none;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 50%;
  }

  .csia-component td:before {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: bold;
    content: attr(data-label);
  }
}
