/**
 * Presale Page Styles
 * Anti_Quantum Token Presale
 */

/* ==================== Page Header ==================== */
.presale-header {
    padding-top: 140px;
    padding-bottom: 60px;
    background: linear-gradient(180deg, rgba(10, 14, 39, 0.9) 0%, rgba(15, 23, 41, 0.95) 100%);
}

.presale-header .page-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.presale-header .page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ==================== Wallet Status Card ==================== */
.wallet-status-card {
    background: var(--bg-card);
    border: 2px solid rgba(0, 255, 204, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.wallet-status-card:hover {
    border-color: rgba(0, 255, 204, 0.4);
    box-shadow: 0 4px 20px rgba(0, 255, 204, 0.15);
}

.btn-wallet-connect {
    width: 100%;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 1rem;
}

.btn-wallet-connect i {
    margin-right: 8px;
}

.wallet-connected .wallet-info {
    margin-bottom: 1rem;
}

.wallet-connected .wallet-address {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 255, 204, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.wallet-connected .wallet-address .btn-copy {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.wallet-connected .wallet-address .btn-copy:hover {
    color: var(--primary-color);
}

.wallet-connected .wallet-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.wallet-connected .balance-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.wallet-connected .balance-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.btn-disconnect {
    width: 100%;
}

/* ==================== Alert Container ==================== */
.alert-container {
    margin-top: -20px;
    margin-bottom: 20px;
}

.security-alert {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 1.5rem;
    border-radius: 10px;
}

.security-alert i {
    font-size: 1.5rem;
}

.security-alert p {
    margin-bottom: 0;
}

/* ==================== Presale Section ==================== */
.presale-section {
    padding-top: 40px;
}

/* ==================== Presale Cards ==================== */
.presale-card {
    background: var(--bg-card);
    border: 2px solid rgba(0, 255, 204, 0.2);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.presale-card:hover {
    border-color: rgba(0, 255, 204, 0.4);
    box-shadow: 0 8px 30px rgba(0, 255, 204, 0.15);
}

.presale-card .card-header {
    background: linear-gradient(135deg, rgba(0, 255, 204, 0.1) 0%, transparent 100%);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 255, 204, 0.1);
}

.presale-card .card-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.presale-card .card-header h3 i {
    color: var(--primary-color);
    margin-right: 10px;
}

.presale-card .card-body {
    padding: 1.5rem;
}

/* ==================== Progress Bar ==================== */
.presale-progress-container {
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.progress-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-percentage {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.presale-progress {
    height: 12px;
    background: rgba(0, 255, 204, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.presale-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
    position: relative;
}

.presale-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-stats {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-stats strong {
    color: var(--text-primary);
}

/* ==================== Stats Grid ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    background: rgba(0, 255, 204, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(0, 255, 204, 0.1);
}

.stat-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    color: var(--bg-primary);
    font-size: 1.2rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* ==================== Team Wallet Section ==================== */
.team-wallet-section {
    margin-bottom: 1.5rem;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-label i {
    color: var(--primary-color);
}

.security-badge {
    background: rgba(0, 255, 100, 0.2);
    color: #00ff64;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.team-wallet-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 255, 204, 0.05);
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 10px;
    padding: 12px 15px;
}

.wallet-address-text {
    flex: 1;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--primary-color);
    word-break: break-all;
}

.btn-icon {
    background: transparent;
    border: 1px solid rgba(0, 255, 204, 0.3);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(0, 255, 204, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-verify {
    border-color: rgba(0, 255, 100, 0.3);
}

.btn-verify:hover {
    border-color: #00ff64;
    color: #00ff64;
}

.btn-explorer {
    border-color: rgba(0, 170, 255, 0.3);
}

.btn-explorer:hover {
    border-color: #00aaff;
    color: #00aaff;
    text-decoration: none;
}

/* Address Verification Hint */
.address-verify-hint {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(0, 255, 100, 0.05);
    border: 1px solid rgba(0, 255, 100, 0.15);
    border-radius: 8px;
}

.verify-hint-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.verify-hint-header i {
    color: #00ff64;
}

.verify-hint-chars {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.hint-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

.hint-value {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #00ff64;
    background: rgba(0, 255, 100, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.hint-separator {
    color: rgba(255, 255, 255, 0.3);
}

.verify-explorer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #00aaff;
    text-decoration: none;
    transition: color 0.2s;
}

.verify-explorer-link:hover {
    color: #00ddff;
    text-decoration: underline;
}

.verify-explorer-link i {
    font-size: 0.75rem;
}

/* ==================== Purchase Form ==================== */
.purchase-form .form-group {
    margin-bottom: 1.5rem;
}

.purchase-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.purchase-form .input-group {
    border: 2px solid rgba(0, 255, 204, 0.2);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.purchase-form .input-group:focus-within {
    border-color: var(--primary-color);
}

.purchase-form .form-control {
    background: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    padding: 15px;
}

.purchase-form .form-control:focus {
    background: var(--bg-secondary);
    box-shadow: none;
    color: var(--text-primary);
}

.purchase-form .form-control::placeholder {
    color: var(--text-muted);
}

.purchase-form .input-group-text {
    background: rgba(0, 255, 204, 0.1);
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    padding: 15px 20px;
}

.input-hint {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.input-hint span {
    color: var(--primary-color);
    font-weight: 600;
}

/* ==================== Token Preview ==================== */
.token-preview {
    background: linear-gradient(135deg, rgba(0, 255, 204, 0.1) 0%, rgba(0, 204, 255, 0.05) 100%);
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.preview-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.preview-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
}

.token-symbol {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-left: 5px;
}

.preview-usd {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ==================== Purchase Button ==================== */
.btn-purchase {
    width: 100%;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-purchase:disabled {
    background: var(--text-muted);
    border-color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-purchase:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 204, 0.4);
}

/* ==================== Allocation Card ==================== */
.allocation-card {
    min-height: 300px;
}

.connect-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
}

.connect-prompt i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.connect-prompt p {
    margin: 0;
    font-size: 1.1rem;
}

.allocation-stat {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1.5rem;
    background: rgba(0, 255, 204, 0.05);
    border-radius: 15px;
    height: 100%;
}

.allocation-stat .stat-icon {
    width: 55px;
    height: 55px;
    font-size: 1.5rem;
}

.allocation-stat .stat-value {
    font-size: 1.25rem;
}

/* ==================== Purchase History ==================== */
.purchase-history h5 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.purchase-history h5 i {
    color: var(--primary-color);
    margin-right: 8px;
}

.purchase-history .table {
    margin-bottom: 0;
}

.purchase-history .table thead th {
    background: rgba(0, 255, 204, 0.1);
    border-color: rgba(0, 255, 204, 0.1);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.purchase-history .table tbody td {
    border-color: rgba(0, 255, 204, 0.05);
    vertical-align: middle;
    color: var(--text-primary);
}

.purchase-history .table tbody tr:hover {
    background: rgba(0, 255, 204, 0.05);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.confirmed {
    background: rgba(0, 255, 100, 0.2);
    color: #00ff64;
}

.status-badge.pending {
    background: rgba(255, 204, 0, 0.2);
    color: #ffcc00;
}

.status-badge.failed {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

.tx-link {
    color: var(--primary-color);
    text-decoration: none;
    font-family: monospace;
    font-size: 0.85rem;
}

.tx-link:hover {
    text-decoration: underline;
}

/* ==================== Claim Section ==================== */
.claim-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(0, 255, 204, 0.05);
    border-radius: 12px;
    flex-wrap: wrap;
}

.claim-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.claim-info i {
    color: var(--primary-color);
}

.btn-claim {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
}

.btn-claim .badge {
    font-size: 0.7rem;
}

/* ==================== Security Notice ==================== */
.security-notice {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 1.5rem;
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 12px;
}

.security-notice i {
    font-size: 1.5rem;
    color: #ffcc00;
}

.security-notice strong {
    color: #ffcc00;
}

.security-notice p {
    margin: 5px 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ==================== Wallet Modal ==================== */
.modal-content {
    background: var(--bg-card);
    border: 2px solid rgba(0, 255, 204, 0.2);
    border-radius: 20px;
}

.modal-header {
    border-bottom: 1px solid rgba(0, 255, 204, 0.1);
    padding: 1.5rem;
}

.modal-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
}

.modal-title i {
    color: var(--primary-color);
    margin-right: 10px;
}

.btn-close {
    filter: invert(1);
}

.modal-body {
    padding: 1.5rem;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.wallet-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wallet-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(0, 255, 204, 0.05);
    border: 2px solid rgba(0, 255, 204, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    text-align: left;
    width: 100%;
}

.wallet-option:hover {
    background: rgba(0, 255, 204, 0.1);
    border-color: var(--primary-color);
}

.wallet-option img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.wallet-option span {
    font-weight: 600;
}

.wallet-option .recommended {
    margin-left: auto;
    background: rgba(0, 255, 204, 0.2);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Connection Method Badges */
.wallet-option .connection-method {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.connection-method.extension {
    background: rgba(0, 255, 100, 0.2);
    color: #00ff64;
}

.connection-method.qrcode {
    background: rgba(0, 150, 255, 0.2);
    color: #0096ff;
}

.connection-method.deeplink {
    background: rgba(255, 200, 0, 0.2);
    color: #ffc800;
}

.connection-method.inapp {
    background: rgba(0, 255, 204, 0.2);
    color: var(--primary-color);
}

.wallet-help-text {
    margin-top: 1.5rem;
    padding: 12px;
    background: rgba(0, 150, 255, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.wallet-help-text i {
    color: #0096ff;
}

/* ==================== QR Code Modal ==================== */
.qr-code-container {
    background: white;
    padding: 20px;
    border-radius: 16px;
    display: inline-block;
    margin-bottom: 1.5rem;
}

#qrCodeDisplay {
    width: 200px;
    height: 200px;
}

#qrCodeDisplay canvas {
    width: 100% !important;
    height: 100% !important;
}

.qr-instruction {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.qr-instruction span {
    color: var(--primary-color);
    font-weight: 600;
}

.qr-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1.5rem;
    text-align: left;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.qr-step {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.step-number {
    width: 28px;
    height: 28px;
    background: rgba(0, 255, 204, 0.2);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.qr-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.qr-actions .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* ==================== Responsive ==================== */
@media (max-width: 991px) {
    .presale-header {
        padding-top: 120px;
        text-align: center;
    }

    .wallet-status-card {
        margin-top: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .claim-section {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 767px) {
    .presale-header .page-title {
        font-size: 1.75rem;
    }

    .allocation-stat {
        flex-direction: column;
        text-align: center;
    }

    .purchase-history {
        overflow-x: auto;
    }
}
