/* ===== STAKING PAGE STYLES ===== */

.stake-page {
    min-height: 100vh;
    padding-top: 140px;
    padding-bottom: 80px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

/* Atmospheric background */
.stake-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(245, 245, 37, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.stake-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ---- Header ---- */
.stake-header {
    text-align: center;
    margin-bottom: 48px;
}

.stake-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent-yellow);
    margin-bottom: 12px;
    display: block;
}

.stake-title {
    font-family: 'HeadingNowVariable', sans-serif;
    font-size: 64px;
    font-weight: 400;
    font-style: italic;
    font-variation-settings: "wdth" 825, "wght" 700;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 2px;
    line-height: 1;
    margin-bottom: 16px;
}

.stake-subtitle {
    font-size: 15px;
    color: rgba(255,255,255,0.4);
    max-width: 480px;
    margin: 0 auto;
}

/* ---- Stats Grid ---- */
.stake-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stake-stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.stat-value.accent {
    color: var(--accent-yellow);
}

.stat-value.rewards {
    color: #4ade80;
}

/* ---- Main Panel ---- */
.stake-panel {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 32px;
}

/* Connect Prompt */
.stake-connect-prompt {
    text-align: center;
    padding: 40px 20px;
}

.connect-icon {
    color: rgba(255,255,255,0.2);
    margin-bottom: 20px;
}

.stake-connect-prompt h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
}

.stake-connect-prompt p {
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    margin-bottom: 24px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.stake-connect-btn {
    background: var(--accent-yellow);
    color: #000;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stake-connect-btn:hover {
    background: #e6e600;
    transform: translateY(-2px);
}

/* ---- Connected Interface ---- */
.stake-interface {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.token-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.04);
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
}

.balance-label {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
}

.balance-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-yellow);
}

/* Tabs */
.stake-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: rgba(255,255,255,0.04);
    padding: 4px;
    border-radius: 10px;
}

.stake-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stake-tab:hover {
    color: rgba(255,255,255,0.8);
}

.stake-tab.active {
    background: rgba(245, 245, 37, 0.15);
    color: var(--accent-yellow);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
}

.input-row {
    display: flex;
    gap: 8px;
}

.input-row input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 16px;
    color: #fff;
    outline: none;
    transition: all 0.2s ease;
}

.input-row input:focus {
    border-color: var(--accent-yellow);
    background: rgba(255,255,255,0.08);
}

.input-row input::placeholder {
    color: rgba(255,255,255,0.3);
}

.max-btn {
    background: rgba(245, 245, 37, 0.15);
    border: 1px solid rgba(245, 245, 37, 0.3);
    color: var(--accent-yellow);
    padding: 0 20px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.max-btn:hover {
    background: rgba(245, 245, 37, 0.25);
}

.input-hint {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    margin-top: 8px;
}

.withdrawal-wallet-group {
    margin-bottom: 24px;
}

.withdrawal-wallet-group input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    color: #fff;
    outline: none;
    transition: all 0.2s ease;
}

.withdrawal-wallet-group input:focus {
    border-color: var(--accent-yellow);
    background: rgba(255,255,255,0.08);
}

.withdrawal-wallet-group input::placeholder {
    color: rgba(255,255,255,0.3);
}

/* Action Buttons */
.stake-action-btn {
    width: 100%;
    background: var(--accent-yellow);
    color: #000;
    border: none;
    padding: 16px 32px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.stake-action-btn:hover:not(:disabled) {
    background: #e6e600;
    transform: translateY(-2px);
}

.stake-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stake-action-btn.secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.stake-action-btn.secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.15);
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Unstake Info */
.unstake-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.unstake-info svg {
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 2px;
}

.unstake-info p {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
}

/* Rewards Summary */
.rewards-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.rewards-card {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.rewards-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-bottom: 8px;
}

.rewards-amount {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.rewards-amount.accent {
    color: #4ade80;
}

/* ---- History Section ---- */
.stake-history {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
}

.history-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

.history-empty {
    text-align: center;
    padding: 32px;
    color: rgba(255,255,255,0.3);
    font-size: 14px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.history-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.history-type.stake {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.history-type.unstake {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.history-type.claim {
    background: rgba(245, 245, 37, 0.15);
    color: var(--accent-yellow);
}

/* ---- Program Info ---- */
.program-info {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 24px;
}

.program-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.program-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-row span {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
}

.program-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-yellow);
    text-decoration: none;
    font-family: 'Inter', monospace;
    font-size: 14px;
    transition: opacity 0.2s;
}

.program-link:hover {
    opacity: 0.8;
}

.network-badge {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .stake-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stake-title {
        font-size: 40px;
    }

    .stake-panel {
        padding: 24px;
    }

    .rewards-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stake-stats-grid {
        grid-template-columns: 1fr;
    }

    .stake-tabs {
        flex-direction: column;
    }

    .input-row {
        flex-direction: column;
    }

    .max-btn {
        padding: 12px;
    }
}

/* ===== PHANTOM WALLET DISPLAY ===== */
.connected-wallet-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(171, 154, 255, 0.15);
    border: 1px solid rgba(171, 154, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Inter', monospace;
    font-size: 13px;
    color: #ab9aff;
}

.wallet-indicator {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.disconnect-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.disconnect-btn:hover {
    color: #ef4444;
}

.phantom-connect-btn {
    background: linear-gradient(135deg, #ab9aff 0%, #8b7be0 100%) !important;
    color: #fff !important;
    border: none !important;
}

.phantom-connect-btn:hover {
    background: linear-gradient(135deg, #c4b8ff 0%, #ab9aff 100%) !important;
}

/* Hide sign-in when wallet connected */
.nav-right:has(.connected-wallet-display[style*="flex"]) .phantom-connect-btn {
    display: none;
}

/* ---- Staked Balance Display ---- */
.staked-balance-display {
    background: rgba(245, 245, 37, 0.08);
    border: 1px solid rgba(245, 245, 37, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.balance-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
}

.check-balance-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.check-balance-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

.check-balance-btn svg {
    opacity: 0.8;
}

.staked-amount-box {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.staked-amount-value {
    font-family: 'HeadingNowVariable', sans-serif;
    font-size: 42px;
    font-weight: 400;
    color: var(--accent-yellow);
    line-height: 1;
}

.staked-amount-label {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== WITHDRAWAL WALLET MODAL ===== */
.stake-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.stake-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.stake-modal-content {
    position: relative;
    background: linear-gradient(180deg, rgba(30, 30, 35, 0.98) 0%, rgba(20, 20, 25, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.stake-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.stake-modal-close:hover {
    color: white;
}

.stake-modal-title {
    font-family: 'HeadingNowVariable', sans-serif;
    font-size: 28px;
    font-weight: 400;
    color: white;
    margin-bottom: 12px;
}

.stake-modal-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 24px;
}

.stake-modal-input-group {
    margin-bottom: 20px;
}

.stake-modal-input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stake-modal-input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-family: 'SF Mono', 'Monaco', monospace;
    transition: border-color 0.2s;
}

.stake-modal-input-group input:focus {
    outline: none;
    border-color: var(--accent-yellow);
}

.stake-modal-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.stake-lookup-result {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.stake-lookup-result.authorized {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.1);
}

.stake-lookup-result.unauthorized {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
}

.stake-lookup-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stake-lookup-title .icon {
    font-size: 18px;
}

.stake-lookup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stake-lookup-row:last-child {
    border-bottom: none;
}

.stake-lookup-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.stake-lookup-value {
    font-size: 13px;
    color: white;
    font-weight: 500;
}

.stake-lookup-value.highlight {
    color: var(--accent-yellow);
    font-size: 18px;
    font-weight: 600;
}

.stake-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.stake-modal-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.stake-modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.stake-modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.stake-modal-btn.primary {
    background: var(--accent-yellow);
    color: black;
}

.stake-modal-btn.primary:hover {
    background: #e6e600;
    transform: translateY(-1px);
}

.stake-modal-btn.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
