/**
 * Certificate Verification Frontend Styles
 */

/* CSS Variables - Dynamically set via PHP */
:root {
  --cv-primary-color: #3b5998;
  --cv-button-color: #4caf50;
  --cv-text-color: #333333;
  --cv-bg-color: #ffffff;
  --cv-border-radius: 8px;
  --cv-title-font-size: 32px;
  --cv-input-font-size: 16px;
  --cv-button-font-size: 16px;
}

/* Verification Wrapper */
.cv-verification-wrapper {
  max-width: 600px;
  margin: 40px auto;
  padding: 20px;
}

/* Verification Card */
.cv-verification-card {
  background: var(--cv-bg-color);
  border-radius: var(--cv-border-radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 40px;
  text-align: center;
}

/* Logo */
.cv-logo {
  margin-bottom: 30px;
  text-align: center;
  animation: cv-fadeIn 0.5s ease;
}

.cv-logo img {
  max-width: 250px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Form Title */
.cv-form-title {
  color: var(--cv-primary-color);
  font-size: var(--cv-title-font-size);
  font-weight: 600;
  margin: 0 0 30px 0;
  line-height: 1.2;
}

/* Form */
.cv-form {
  margin-top: 20px;
}

.cv-form-group {
  margin-bottom: 20px;
}

/* Input Field */
.cv-input {
  width: 100%;
  padding: 15px 20px;
  font-size: var(--cv-input-font-size);
  border: 2px solid #e0e0e0;
  border-radius: var(--cv-border-radius);
  outline: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
  color: var(--cv-text-color);
}

.cv-input:focus {
  border-color: var(--cv-primary-color);
  box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.1);
}

.cv-input::placeholder {
  color: #999;
}

/* Button */
.cv-button {
  padding: 15px 40px;
  font-size: var(--cv-button-font-size);
  font-weight: 600;
  border: none;
  border-radius: var(--cv-border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cv-button-primary {
  background: var(--cv-button-color);
  color: #ffffff;
}

.cv-button-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.cv-button-primary:active {
  transform: translateY(0);
}

.cv-button-secondary {
  background: transparent;
  color: var(--cv-primary-color);
  border: 2px solid var(--cv-primary-color);
}

.cv-button-secondary:hover {
  background: var(--cv-primary-color);
  color: #ffffff;
}

/* Loading Spinner */
.cv-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  color: var(--cv-text-color);
}

.cv-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--cv-primary-color);
  border-radius: 50%;
  animation: cv-spin 1s linear infinite;
}

@keyframes cv-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Modal */
.cv-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cv-fadeIn 0.3s ease;
}

.cv-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.cv-modal-content {
  position: relative;
  background: var(--cv-bg-color);
  border-radius: var(--cv-border-radius);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: cv-slideUp 0.3s ease;
  z-index: 1;
}

.cv-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 32px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  transition: color 0.3s ease;
  z-index: 2;
}

.cv-modal-close:hover {
  color: #333;
}

.cv-modal-body {
  padding: 40px;
  text-align: center;
}

/* Modal Success Content */
.cv-modal-logo {
  margin-bottom: 20px;
  text-align: center;
}

.cv-modal-logo img {
  max-width: 200px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.cv-success-badge {
  display: inline-block;
  background: #4caf50;
  color: #ffffff;
  padding: 10px 30px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.cv-certificate-info {
  margin: 30px 0;
  text-align: left;
}

.cv-certificate-info p {
  margin: 10px 0;
  font-size: 16px;
  color: var(--cv-text-color);
  line-height: 1.6;
}

.cv-certificate-info strong {
  color: var(--cv-primary-color);
  font-weight: 600;
}

.cv-certificate-message {
  font-size: 18px;
  color: var(--cv-text-color);
  margin: 20px 0;
  line-height: 1.6;
}

.cv-student-card {
  background: #f5f5f5;
  border-radius: var(--cv-border-radius);
  padding: 20px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.cv-student-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--cv-primary-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  flex-shrink: 0;
}

.cv-student-details {
  text-align: left;
  flex: 1;
}

.cv-student-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--cv-text-color);
  margin: 0 0 5px 0;
}

.cv-student-email {
  font-size: 14px;
  color: #666;
  margin: 0;
}

.cv-certificate-image {
  margin: 20px 0;
}

.cv-certificate-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--cv-border-radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Modal Error Content */
.cv-error-icon {
  font-size: 64px;
  color: #f44336;
  margin-bottom: 20px;
}

.cv-error-message {
  font-size: 18px;
  color: var(--cv-text-color);
  margin: 20px 0;
}

/* Animations */
@keyframes cv-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes cv-slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .cv-verification-card {
    padding: 30px 20px;
  }

  .cv-form-title {
    font-size: 24px;
  }

  .cv-input {
    padding: 12px 15px;
    font-size: 14px;
  }

  .cv-button {
    padding: 12px 30px;
    font-size: 14px;
  }

  .cv-modal-content {
    width: 95%;
  }

  .cv-modal-body {
    padding: 30px 20px;
  }

  .cv-student-card {
    flex-direction: column;
    text-align: center;
  }

  .cv-student-details {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .cv-verification-wrapper {
    padding: 10px;
  }

  .cv-form-title {
    font-size: 20px;
  }
}
