/**
 * LittleBill Loyalty Styles
 * Custom styles for loyalty program components
 */

/* Checkout Loyalty Section */
#littlebill-loyalty-section {
  background: #00aa7714;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin: 20px 0;
}

#littlebill-information-modal {
  z-index: 1300;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.littlebill-information-modal-content {
  background: #fff;
  width: 50%;
  max-width: 90%;
  padding: 25px;
  border-radius: 8px;
  position: relative;
  animation: wooFadeIn 0.2s ease-in-out;
}

#littlebill-information-modal-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #28712f;
  color: #28712f;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#littlebill-information-modal-btn:hover {
  border: 2px solid #ffffff;
  background: #00aa7714;
  color: #ffffff;
}

#littlebill-information-modal-content ul {
  padding-left: 40px;
}

@keyframes wooFadeIn {
   from { transform: scale(0.95); opacity: 0; }
   to { transform: scale(1); opacity: 1; }
}

#littlebill-loyalty-section h3 {
  margin-bottom: 16px;
  margin-top: inherit;
  font-size: 1.6em;
  color: #28712f;
}

#littlebill-loyalty-section p {
  margin-bottom: 15px;
  color: #495057;
}

/* Phone Input Styling */
#littlebill_phone {
  width: 100%;
  padding: 12px;
  border: 2px solid #ced4da;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

#littlebill_phone:focus {
  border-color: #007cba;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

#littlebill_phone.error {
  border-color: #dc3545;
}

/* Loyalty Benefits */
.loyalty-benefits {
  margin-top: 20px;
  padding: 15px;
  background: #e7f3ff;
  border-radius: 4px;
  border-left: 4px solid #007cba;
}

.loyalty-benefits h4 {
  margin-top: 0;
  color: #007cba;
  font-size: 1.1em;
}

.loyalty-benefits ul {
  margin-bottom: 0;
  padding-left: 20px;
}

.loyalty-benefits li {
  margin-bottom: 8px;
  color: #495057;
}

/* My Account Loyalty Section */
.littlebill-loyalty-account {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-bottom: 30px;
}

.littlebill-loyalty-account h2 {
  color: #007cba;
  margin-bottom: 20px;
  font-size: 1.5em;
}

/**********************/
/*** LITTLEBILL LOYALTY ACCOUNT ***/
/**********************/

.loyalty-points {
  margin-bottom: 25px;
}

.loyalty-points h3 {
  color: #495057;
  margin-bottom: 10px;
  font-size: 1.2em;
}

.points-display {
  font-size: 1.3em;
  font-weight: bold;
  color: #28a745;
  background: #d4edda;
  padding: 15px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid #c3e6cb;
}

.loyalty-info h3 {
  color: #495057;
  margin-bottom: 15px;
  font-size: 1.2em;
}

.loyalty-info ul {
  padding-left: 20px;
}

.loyalty-info li {
  margin-bottom: 10px;
  color: #495057;
}

/* Join Loyalty Form */
.littlebill-join-loyalty {
  background: #fff3cd;
  padding: 25px;
  border-radius: 8px;
  border: 1px solid #ffeaa7;
  margin-bottom: 30px;
}

.littlebill-join-loyalty h2 {
  color: #856404;
  margin-bottom: 15px;
  font-size: 1.5em;
}

.littlebill-join-loyalty p {
  color: #856404;
  margin-bottom: 20px;
  line-height: 1.6;
}

.littlebill-join-loyalty .form-row {
  margin-bottom: 20px;
}

.littlebill-join-loyalty label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #856404;
}

.littlebill-join-loyalty input[type="tel"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #ced4da;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.littlebill-join-loyalty input[type="tel"]:focus {
  border-color: #007cba;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.littlebill-join-loyalty button {
  background: #007cba;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.littlebill-join-loyalty button:hover {
  background: #005a87;
}

.littlebill-join-loyalty button:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

.loyalty-offers {
  margin-top: 24px;
}

.loyalty-offers h3 {
  font-size: 1.2em;
  margin-bottom: 15px;
}

/*********JOIN LOYALTY FORM************/

.littlebill-pending-status {
  background: #fff3cd;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #ffeaa7;
  margin-bottom: 20px;
}

.littlebill-pending-status h2 {
  color: #856404;
  margin-bottom: 15px;
}

.pending-message {
  margin-bottom: 20px;
}

.pending-message .woocommerce-info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.phone-info {
  font-weight: bold;
  color: #495057;
}

.pending-info h3 {
  color: #856404;
  margin-bottom: 10px;
}

.pending-info ul {
  list-style-type: disc;
  margin-left: 20px;
}

.pending-info li {
  margin-bottom: 5px;
  color: #6c757d;
}

.help-text {
  font-style: italic;
  color: #6c757d;
  margin-top: 15px;
}

.auto-check-info {
  background: #e7f3ff;
  padding: 15px;
  border-radius: 4px;
  border: 1px solid #b3d9ff;
}

.info-text {
  color: #0c5460;
  margin: 0;
  font-style: italic;
}

/*** LOYALTY OFFERS ***/

.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  width: 100%;
  gap: 16px;
  justify-items: center;
}

.offer-card {
  background-color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.6rem;
  border-radius: 0.8rem;
  width: 120px;
  height: 100%;
}

.offer-card img {
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 8rem;
  margin: 0 auto;
  border-top-left-radius: 0.6rem;
  border-top-right-radius: 0.6rem;
}

.offer-content {
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.offer-text {
  flex: 1;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.offer-points {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.offer-description {
  font-size: 0.9rem;
  margin-top: 8px;
  line-height: 1.2;
}

.circle-progress {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.circle-progress::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  z-index: 1;
}

.circle-text {
  position: absolute;
  color: #28a745;
  z-index: 2;
  font-size: 0.8rem;
}

/**********************/
/*** MESSAGES ***/
/**********************/

#littlebill-message {
  margin-top: 15px;
}

#littlebill-message .woocommerce-message {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 12px;
  border-radius: 4px;
  margin: 0;
}

#littlebill-message .woocommerce-info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
  padding: 12px;
  border-radius: 4px;
  margin: 0;
}

#littlebill-message .woocommerce-error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 12px;
  border-radius: 4px;
  margin: 0;
}

/* New Client Creation Fields */
#littlebill-new-client-fields {
  margin-top: 20px;
  padding: 20px;
  background: #fff3cd;
  border-radius: 8px;
  border: 1px solid #ffeaa7;
}

#littlebill-new-client-fields h4 {
  color: #856404;
  margin-bottom: 15px;
  font-size: 1.2em;
}

#littlebill-new-client-fields p {
  color: #856404;
  margin-bottom: 20px;
  line-height: 1.6;
}

.littlebill-create-account-info {
  margin: 20px 0;
  padding: 15px;
  background: #e7f3ff;
  border-radius: 4px;
  border-left: 4px solid #007cba;
}

.littlebill-create-account-info p {
  margin-bottom: 10px;
  color: #495057;
}

.littlebill-create-account-info ul {
  margin-bottom: 0;
  padding-left: 20px;
}

.littlebill-create-account-info li {
  margin-bottom: 8px;
  color: #495057;
}

.littlebill-create-account-button {
  margin-top: 20px;
  text-align: center;
}

#littlebill-create-account-btn {
  background: #007cba;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  min-width: 200px;
}

#littlebill-create-account-btn:hover {
  background: #005a87;
}

#littlebill-create-account-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

/* Date of Birth Field */
#littlebill_date_of_birth {
  width: 100%;
  padding: 12px;
  border: 2px solid #ced4da;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

#littlebill_date_of_birth:focus {
  border-color: #007cba;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Admin Styles */
.littlebill-dependent {
  transition: opacity 0.3s ease;
}

.littlebill-dependent.hidden {
  opacity: 0.5;
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  #littlebill-loyalty-section,
  .littlebill-loyalty-account,
  .littlebill-join-loyalty {
    padding: 15px;
  }

  .points-display {
    font-size: 1.1em;
    padding: 12px;
  }

  .littlebill-join-loyalty button {
    width: 100%;
    padding: 15px;
  }
}

/* Loading States */
.littlebill-loading {
  opacity: 0.6;
  pointer-events: none;
}

.littlebill-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007cba;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Success States */
.littlebill-success {
  border-color: #28a745 !important;
  background-color: #d4edda !important;
}

/* Error States */
.littlebill-error {
  border-color: #dc3545 !important;
  background-color: #f8d7da !important;
}

/* Tooltip Styles */
.littlebill-tooltip {
  position: relative;
  display: inline-block;
}

.littlebill-tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
}

.littlebill-tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Pending Status Styles */
.littlebill-pending-checkout {
  border-radius: 6px;
  margin: 16px 0;
  font-size: 1em;
}

.littlebill-pending-checkout .woocommerce-info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.littlebill-pending-checkout p {
  margin-bottom: 10px;
  color: #856404;
}

.littlebill-pending-checkout small {
  color: #6c757d;
  font-style: italic;
}

.littlebill-pending-status {
  background: #fff3cd;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #ffeaa7;
  margin-bottom: 20px;
}

.littlebill-pending-status h2 {
  color: #856404;
  margin-bottom: 15px;
}

.pending-message {
  margin-bottom: 20px;
}

.pending-message .woocommerce-info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.phone-info {
  font-weight: bold;
  color: #495057;
}

.pending-info h3 {
  color: #856404;
  margin-bottom: 10px;
}

.pending-info ul {
  list-style-type: disc;
  margin-left: 20px;
}

.pending-info li {
  margin-bottom: 5px;
  color: #6c757d;
}

.help-text {
  font-style: italic;
  color: #6c757d;
  margin-top: 15px;
}

/* Print Styles */
@media print {
  #littlebill-loyalty-section,
  .littlebill-loyalty-account,
  .littlebill-join-loyalty,
  .littlebill-pending-checkout,
  .littlebill-pending-status {
    display: none;
  }
}
