/* GhostGen Modal System */
:root {
    --modal-black: #0a0a0a;
    --modal-card-black: #151515;
    --modal-accent-green: #00ff88;
    --modal-accent-green-dark: #00cc6a;
    --modal-text-primary: #f0f0f0;
    --modal-text-secondary: #aaaaaa;
    --modal-border-color: #222222;
    --modal-overlay: rgba(0, 0, 0, 0.85);
    --modal-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* Modal Overlay */
.ghostgen-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ghostgen-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.ghostgen-modal {
    background: var(--modal-card-black);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--modal-border-color);
    box-shadow: var(--modal-shadow);
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
    overflow: hidden;
    position: relative;
}

.ghostgen-modal-overlay.active .ghostgen-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Modal Header */
.ghostgen-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--modal-accent-green), var(--modal-accent-green-dark));
}

.ghostgen-modal-header {
    padding: 2rem 2rem 1rem;
    position: relative;
}

.ghostgen-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: rgba(0, 255, 136, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
    color: var(--modal-accent-green);
}

.ghostgen-modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--modal-text-primary);
}

.ghostgen-modal-subtitle {
    text-align: center;
    color: var(--modal-text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

/* Modal Body */
.ghostgen-modal-body {
    padding: 1rem 2rem 2rem;
}

.ghostgen-modal-message {
    color: var(--modal-text-primary);
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 1.5rem;
}

.ghostgen-modal-input {
    width: 100%;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--modal-border-color);
    border-radius: 10px;
    color: var(--modal-text-primary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s;
}

.ghostgen-modal-input:focus {
    outline: none;
    border-color: var(--modal-accent-green);
}

/* Modal Footer */
.ghostgen-modal-footer {
    display: flex;
    gap: 1rem;
    padding: 0 2rem 2rem;
}

.ghostgen-modal-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
}

/* Primary Button (Confirm/Accept) */
.ghostgen-modal-btn.primary {
    background: linear-gradient(90deg, var(--modal-accent-green-dark), var(--modal-accent-green));
    color: var(--modal-black);
}

.ghostgen-modal-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.ghostgen-modal-btn.primary:active {
    transform: translateY(-1px);
}

/* Secondary Button (Cancel/Decline) */
.ghostgen-modal-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--modal-text-primary);
    border: 1px solid var(--modal-border-color);
}

.ghostgen-modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--modal-accent-green);
    color: var(--modal-accent-green);
}

/* Danger Button */
.ghostgen-modal-btn.danger {
    background: rgba(255, 50, 50, 0.1);
    color: #ff5555;
    border: 1px solid rgba(255, 50, 50, 0.3);
}

.ghostgen-modal-btn.danger:hover {
    background: rgba(255, 50, 50, 0.2);
    transform: translateY(-3px);
}

/* Success Button */
.ghostgen-modal-btn.success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--modal-accent-green);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.ghostgen-modal-btn.success:hover {
    background: rgba(0, 255, 136, 0.2);
    transform: translateY(-3px);
}

/* Loading State */
.ghostgen-modal-loading, #genLoading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

#genLoading {
    padding-top: 0;
}

.ghostgen-modal-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 255, 136, 0.1);
    border-top-color: var(--modal-accent-green);
    border-radius: 50%;
    animation: ghostgen-spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes ghostgen-spin {
    to {
        transform: rotate(360deg);
    }
}

.ghostgen-modal-loading-text {
    color: var(--modal-text-secondary);
    font-size: 1rem;
    text-align: center;
}

/* Toast Notification */
.ghostgen-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--modal-card-black);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--modal-accent-green);
    border: 1px solid var(--modal-border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
    max-width: 400px;
}

.ghostgen-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.ghostgen-toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(0, 255, 136, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--modal-accent-green);
    flex-shrink: 0;
}

.ghostgen-toast-content {
    flex: 1;
}

.ghostgen-toast-title {
    font-weight: 600;
    color: var(--modal-text-primary);
    margin-bottom: 0.3rem;
}

.ghostgen-toast-message {
    color: var(--modal-text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.ghostgen-toast-close {
    background: transparent;
    border: none;
    color: var(--modal-text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.2rem;
    transition: color 0.3s;
}

.ghostgen-toast-close:hover {
    color: var(--modal-accent-green);
}

/* Toast Types */
.ghostgen-toast.success {
    border-left-color: var(--modal-accent-green);
}

.ghostgen-toast.success .ghostgen-toast-icon {
    color: var(--modal-accent-green);
}

.ghostgen-toast.error {
    border-left-color: #ff5555;
}

.ghostgen-toast.error .ghostgen-toast-icon {
    color: #ff5555;
    background: rgba(255, 85, 85, 0.1);
}

.ghostgen-toast.warning {
    border-left-color: #ff9900;
}

.ghostgen-toast.warning .ghostgen-toast-icon {
    color: #ff9900;
    background: rgba(255, 153, 0, 0.1);
}

.ghostgen-toast.info {
    border-left-color: #5865F2;
}

.ghostgen-toast.info .ghostgen-toast-icon {
    color: #5865F2;
    background: rgba(88, 101, 242, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .ghostgen-modal {
        width: 95%;
        max-width: 400px;
    }
    
    .ghostgen-modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .ghostgen-modal-body {
        padding: 1rem 1.5rem 1.5rem;
    }
    
    .ghostgen-modal-footer {
        padding: 0 1.5rem 1.5rem;
        flex-direction: column;
    }
    
    .ghostgen-toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .ghostgen-modal-title {
        font-size: 1.5rem;
    }
    
    .ghostgen-modal-message {
        font-size: 1rem;
    }
    
    .ghostgen-modal-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

/* Success check icon */
.ghostgen-modal-check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00e676, #00c853);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b1f14;
  font-size: 26px;
  box-shadow: 0 0 0 rgba(0, 230, 118, 0.6);
  animation: tada 0.9s ease forwards;
  margin-bottom: 1.5rem;
}

/* Tada animation */
@keyframes tada {
  0% {
    transform: scale(0.7);
    box-shadow: 0 0 0 rgba(0, 230, 118, 0);
  }
  40% {
    transform: scale(1.15);
    box-shadow: 0 0 25px rgba(0, 230, 118, 0.6);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 18px rgba(0, 230, 118, 0.4);
  }
}

#hcaptcha-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.upgrade-modal {
  max-width: 420px;
  padding: 24px;
  background: linear-gradient(180deg, #12121a, #0b0b11);
  border-radius: 16px;
  position: relative;
  color: #fff;
}

.ghostgen-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
}

.ghostgen-modal-header {
  text-align: center;
  margin-bottom: 16px;
}

.ghostgen-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.upgrade-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.upgrade-steps li {
  padding: 10px 0;
  border-bottom: 1px solid #1f1f2e;
  font-size: 14px;
  display: flex;
  gap: 10px;
}

.upgrade-steps li::before {
  content: "✓";
  color: var(--modal-accent-green-dark);
  font-weight: bold;
}

.discord-join-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #5865f2;
  color: #fff;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.discord-join-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(88, 101, 242, 0.4);
}

.upgrade-note {
  text-align: center;
  font-size: 12px;
  color: #aaa;
  margin-top: 12px;
}