/* TOKEN FORGE — SPL Token Launcher */

:root {
    --tf-amber: #F5A623;
    --tf-amber-bright: #FFB800;
    --tf-amber-dim: rgba(245, 166, 35, 0.6);
    --tf-amber-glow: rgba(245, 166, 35, 0.15);
    --tf-amber-border: rgba(245, 166, 35, 0.3);
    --tf-amber-bg: rgba(245, 166, 35, 0.08);
    --tf-red: #FF4444;
    --tf-green: #14F195;
}

.tf-container {
    max-width: clamp(900px, 80vw, 1400px);
    margin: 0 auto;
    padding: 0 2rem 3rem;
}

/* ── Wallet Bar ────────────────────────────────────────────── */

.tf-wallet-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(16, 16, 16, 0.6);
    border: 1px solid var(--tf-amber-border);
}

.tf-wallet-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

.tf-wallet-status.connected {
    color: var(--tf-amber);
}

.tf-wallet-btn {
    background: var(--tf-amber-bg);
    border: 1px solid var(--tf-amber-border);
    color: var(--tf-amber);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 2px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tf-wallet-btn:hover {
    background: rgba(245, 166, 35, 0.25);
    border-color: var(--tf-amber);
}

.tf-wallet-btn.disconnect {
    border-color: rgba(255, 50, 50, 0.3);
    color: rgba(255, 50, 50, 0.7);
    background: rgba(255, 50, 50, 0.08);
}

.tf-wallet-btn.disconnect:hover {
    border-color: rgba(255, 50, 50, 0.6);
    background: rgba(255, 50, 50, 0.15);
}

/* ── Form ──────────────────────────────────────────────────── */

.tf-form {
    background: rgba(16, 16, 16, 0.85);
    border: 1px solid var(--border);
    border-left: 3px solid var(--tf-amber-dim);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.tf-form-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    color: var(--tf-amber);
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(245, 166, 35, 0.15);
}

.tf-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 700px) {
    .tf-form-grid { grid-template-columns: 1fr; }
}

.tf-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.tf-field.full-width {
    grid-column: 1 / -1;
}

.tf-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
}

.tf-label-hint {
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.5px;
    margin-top: 0.15rem;
}

.tf-input,
.tf-select,
.tf-textarea {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(245, 166, 35, 0.15);
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 0.65rem 0.85rem;
    outline: none;
    transition: all 0.25s ease;
    letter-spacing: 0.5px;
}

.tf-input:focus,
.tf-select:focus,
.tf-textarea:focus {
    border-color: var(--tf-amber-dim);
    box-shadow: 0 0 15px rgba(245, 166, 35, 0.1);
}

.tf-input::placeholder,
.tf-textarea::placeholder {
    color: rgba(255, 255, 255, 0.15);
}

.tf-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23F5A623' viewBox='0 0 16 16'%3E%3Cpath d='M8 12L2 6h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.tf-select option {
    background: #111;
    color: #fff;
}

.tf-textarea {
    resize: vertical;
    min-height: 60px;
}

/* ── Checkboxes ────────────────────────────────────────────── */

.tf-checkboxes {
    grid-column: 1 / -1;
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.tf-checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
}

.tf-checkbox-wrap input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--tf-amber-border);
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin-top: 1px;
}

.tf-checkbox-wrap input[type="checkbox"]:checked {
    background: var(--tf-amber-bg);
    border-color: var(--tf-amber);
}

.tf-checkbox-wrap input[type="checkbox"]:checked::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--tf-amber);
    font-size: 0.65rem;
}

.tf-checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tf-checkbox-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.tf-checkbox-rec {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5rem;
    color: var(--tf-amber-dim);
    letter-spacing: 0.5px;
}

/* ── Fee Display ───────────────────────────────────────────── */

.tf-fee-section {
    grid-column: 1 / -1;
    background: rgba(245, 166, 35, 0.04);
    border: 1px solid rgba(245, 166, 35, 0.12);
    padding: 1rem;
    margin-top: 0.5rem;
}

.tf-fee-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: var(--tf-amber);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.tf-fee-row {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    padding: 0.2rem 0;
}

.tf-fee-label { color: rgba(255, 255, 255, 0.4); }
.tf-fee-value { color: rgba(255, 255, 255, 0.7); }

.tf-fee-total {
    border-top: 1px solid rgba(245, 166, 35, 0.15);
    margin-top: 0.35rem;
    padding-top: 0.5rem;
}

.tf-fee-total .tf-fee-value {
    color: var(--tf-amber);
    font-weight: 700;
}

/* ── Deploy Button ─────────────────────────────────────────── */

.tf-deploy-section {
    grid-column: 1 / -1;
    margin-top: 0.75rem;
}

.tf-deploy-btn {
    width: 100%;
    padding: 1rem;
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid var(--tf-amber-dim);
    color: var(--tf-amber);
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    letter-spacing: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tf-deploy-btn:hover:not(:disabled) {
    background: rgba(245, 166, 35, 0.2);
    border-color: var(--tf-amber-bright);
    box-shadow: 0 0 30px rgba(245, 166, 35, 0.2), inset 0 0 30px rgba(245, 166, 35, 0.05);
    transform: translateY(-1px);
}

.tf-deploy-btn:active:not(:disabled) {
    transform: translateY(0);
}

.tf-deploy-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.tf-deploy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(245, 166, 35, 0.08), transparent);
    transition: left 0.6s ease;
}

.tf-deploy-btn:hover:not(:disabled)::before {
    left: 100%;
}

/* ── Status Panel ──────────────────────────────────────────── */

.tf-status {
    background: rgba(16, 16, 16, 0.85);
    border: 1px solid var(--border);
    border-left: 3px solid var(--tf-amber-dim);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: none;
}

.tf-status.active { display: block; }

.tf-status-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tf-status-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    letter-spacing: 2px;
}

.tf-status.building  .tf-status-title,
.tf-status.awaiting  .tf-status-title,
.tf-status.confirming .tf-status-title { color: var(--tf-amber); }

.tf-status.success .tf-status-title { color: var(--tf-green); }
.tf-status.success { border-left-color: rgba(20, 241, 149, 0.6); }

.tf-status.error .tf-status-title { color: var(--tf-red); }
.tf-status.error { border-left-color: rgba(255, 68, 68, 0.6); }

.tf-status-body {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.8;
}

.tf-status-body a {
    color: var(--tf-amber);
    text-decoration: none;
}

.tf-status-body a:hover { text-decoration: underline; }

.tf-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(245, 166, 35, 0.2);
    border-top-color: var(--tf-amber);
    border-radius: 50%;
    animation: tf-spin 0.8s linear infinite;
}

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

/* ── Result Details ────────────────────────────────────────── */

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

.tf-result-row:last-child { border-bottom: none; }

.tf-result-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 2px;
    flex-shrink: 0;
}

.tf-result-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
    word-break: break-all;
    text-align: right;
    max-width: 60%;
}

/* ── Modals ────────────────────────────────────────────────── */

.tf-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1000;
    display: none;
}

.tf-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tf-modal-backdrop {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.tf-modal-content {
    position: relative;
    background: rgba(16, 16, 16, 0.98);
    border: 1px solid var(--tf-amber-border);
    border-left: 3px solid var(--tf-amber-dim);
    max-width: 550px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
}

.tf-modal-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    color: var(--tf-amber);
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(245, 166, 35, 0.15);
}

.tf-modal-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
}

.tf-modal-label {
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 2px;
    flex-shrink: 0;
}

.tf-modal-value {
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
    max-width: 55%;
    word-break: break-all;
}

.tf-modal-warning {
    background: rgba(255, 68, 68, 0.05);
    border: 1px solid rgba(255, 68, 68, 0.15);
    padding: 0.75rem;
    margin: 1rem 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    color: rgba(255, 68, 68, 0.75);
    line-height: 1.7;
    letter-spacing: 0.5px;
}

.tf-modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.tf-modal-cancel {
    flex: 1;
    padding: 0.7rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.4);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tf-modal-cancel:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
}

.tf-modal-confirm {
    flex: 1.5;
    padding: 0.7rem;
    background: rgba(245, 166, 35, 0.12);
    border: 1px solid var(--tf-amber-dim);
    color: var(--tf-amber);
    font-family: 'Orbitron', monospace;
    font-size: 0.65rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tf-modal-confirm:hover {
    background: rgba(245, 166, 35, 0.2);
    border-color: var(--tf-amber);
    box-shadow: 0 0 20px rgba(245, 166, 35, 0.15);
}

/* ── Wallet Picker ─────────────────────────────────────────── */

.tf-wallet-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(245, 166, 35, 0.12);
    color: rgba(255, 255, 255, 0.7);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
}

.tf-wallet-option:hover {
    background: rgba(245, 166, 35, 0.08);
    border-color: var(--tf-amber-border);
    color: var(--tf-amber);
}

.tf-wallet-install {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.3);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.tf-wallet-install:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 600px) {
    .tf-container { padding: 0 1rem 2rem; }
    .tf-form { padding: 1.25rem; }
    .tf-modal-content { padding: 1.25rem; }
    .tf-modal-actions { flex-direction: column; }
    .tf-result-row { flex-direction: column; gap: 0.25rem; align-items: flex-start; }
    .tf-result-value { text-align: left; max-width: 100%; }
    .tf-checkboxes { flex-direction: column; gap: 1rem; }
    .tf-wallet-bar { flex-direction: column; gap: 0.75rem; text-align: center; }
}

.hidden { display: none !important; }
