/**
 * Kirov Licensing Customer Portal Styles
 */

/* Customer Portal Container */
.kirov-customer-portal {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.kirov-customer-portal h2 {
  color: #333;
  margin-bottom: 20px;
  border-bottom: 2px solid #0073aa;
  padding-bottom: 10px;
}

/* License Cards Grid */
.kirov-licenses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .kirov-licenses-grid {
    grid-template-columns: 1fr;
  }
}

/* Individual License Card */
.kirov-license-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.kirov-license-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.kirov-license-card.expiring-soon {
  border-left: 4px solid #ffb900;
  background: #fff8e1;
}

.kirov-license-card.expired {
  border-left: 4px solid #d63638;
  background: #fef7f7;
}

.kirov-license-card.active {
  border-left: 4px solid #00a32a;
}

/* License Card Header */
.license-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.license-product-name {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.license-plan-badge {
  background: #0073aa;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

/* Status Badges */
.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.status-badge.status-active {
  background: #d1e7dd;
  color: #0f5132;
}

.status-badge.status-expired {
  background: #f8d7da;
  color: #721c24;
}

.status-badge.status-expiring {
  background: #fff3cd;
  color: #856404;
}

.status-badge.status-inactive {
  background: #e2e3e5;
  color: #383d41;
}

.status-badge.status-suspended {
  background: #f1c0c7;
  color: #721c24;
}

/* License Info Grid */
.license-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
}

@media (max-width: 480px) {
  .license-info-grid {
    grid-template-columns: 1fr;
  }
}

.license-info-item {
  display: flex;
  flex-direction: column;
}

.license-info-item label {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.license-info-item span {
  font-size: 14px;
  color: #333;
}

/* License Key Display */
.license-key-container {
  grid-column: 1 / -1;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.license-key-display {
  font-family: "Courier New", monospace;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  word-break: break-all;
}

.show-full-key {
  color: #0073aa;
  text-decoration: none;
  font-size: 12px;
  margin-left: 10px;
}

.show-full-key:hover {
  text-decoration: underline;
}

/* Expiration Warning */
.expiration-warning {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 14px;
}

.expiration-warning.expired {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.expiration-warning strong {
  font-weight: 600;
}

/* Card Actions */
.license-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.kirov-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.kirov-btn:hover {
  text-decoration: none;
}

.kirov-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.kirov-btn-primary {
  background: #0073aa;
  color: white;
}

.kirov-btn-primary:hover {
  background: #005a87;
  color: white;
}

.kirov-btn-secondary {
  background: #6c757d;
  color: white;
}

.kirov-btn-secondary:hover {
  background: #5a6268;
  color: white;
}

.kirov-btn-outline {
  background: transparent;
  color: #0073aa;
  border: 1px solid #0073aa;
}

.kirov-btn-outline:hover {
  background: #0073aa;
  color: white;
}

/* Renewal Cart Actions */
.renewal-cart-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.renewal-cart-actions .button {
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  display: inline-block;
  text-align: center;
  transition: all 0.3s ease;
}

.renewal-cart-actions .button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 480px) {
  .renewal-cart-actions {
    flex-direction: column;
  }

  .renewal-cart-actions .button {
    width: 100%;
    margin-bottom: 5px;
  }
}

/* Modal Styles */
.kirov-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: none;
}

.kirov-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.kirov-modal-header {
  display: flex;
  justify-content: flex-end;
  padding: 15px 20px 0;
}

.kirov-modal-close {
  font-size: 24px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.kirov-modal-close:hover {
  color: #333;
}

.kirov-modal-content {
  padding: 0 20px 20px;
}

/* License Details Modal */
.kirov-license-details h3 {
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.kirov-license-details h4 {
  color: #333;
  margin: 20px 0 10px;
}

/* License Actions */
.license-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.license-actions .button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.license-actions .download-plugin {
  background: #28a745;
  color: white;
  border-color: #28a745;
}

.license-actions .download-plugin:hover {
  background: #218838;
  border-color: #1e7e34;
  color: white;
}

.license-actions .view-details {
  background: #6c757d;
  color: white;
  border-color: #6c757d;
}

.license-actions .view-details:hover {
  background: #5a6268;
  border-color: #545b62;
  color: white;
}

.license-actions .button-primary {
  background: #0073aa;
  color: white;
  border-color: #0073aa;
}

.license-actions .button-primary:hover {
  background: #005a87;
  border-color: #004c75;
  color: white;
}

/* Active Sites in Modal */
.active-sites-list {
  margin-top: 15px;
}

.active-site-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.active-site-item:last-child {
  margin-bottom: 0;
}

.site-info {
  flex: 1;
}

.site-info .site-url {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.site-info .activation-date {
  font-size: 12px;
  color: #666;
}

.site-actions {
  margin-left: 15px;
}

.site-actions .deactivate-site {
  background: #dc3545;
  color: white;
  border: 1px solid #dc3545;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.site-actions .deactivate-site:hover {
  background: #c82333;
  border-color: #bd2130;
  color: white;
}

.site-actions .deactivate-site:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.no-active-sites {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 4px;
  margin-top: 15px;
}

/* Notifications */
.kirov-notification {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-weight: 500;
}

.kirov-notification-success {
  background: #d1e7dd;
  color: #0f5132;
  border: 1px solid #badbcc;
}

.kirov-notification-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.kirov-notification-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.kirov-notification-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Loading States */
.kirov-loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.kirov-loading:before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #0073aa;
  border-radius: 50%;
  animation: kirov-spin 1s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

@keyframes kirov-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.kirov-error {
  text-align: center;
  padding: 20px;
  color: #721c24;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
}

/* Empty State */
.kirov-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.kirov-empty-state h3 {
  color: #333;
  margin-bottom: 10px;
}

.kirov-empty-state p {
  margin-bottom: 20px;
}

/* Usage Statistics */
.usage-stats {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 10px;
}

.usage-stat {
  text-align: center;
  flex: 1;
}

.usage-stat-value {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  display: block;
}

.usage-stat-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
}

/* Responsive Design */
@media (max-width: 768px) {
  .kirov-customer-portal {
    padding: 15px;
  }

  .license-card-actions {
    flex-direction: column;
  }

  .kirov-btn {
    justify-content: center;
  }

  .usage-stats {
    flex-direction: column;
    gap: 10px;
  }
}

/* WooCommerce My Account Integration */
.woocommerce-account .kirov-customer-portal {
  padding: 0;
}

.woocommerce-account .kirov-customer-portal h2 {
  margin-top: 0;
}
