:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-glass: rgba(30, 30, 30, 0.6);
    --tg-blue: #2AABEE;
    --tg-blue-hover: #229ED9;
    --text: #ffffff;
    --text-secondary: #8e8e93;
    --success: #34C759;
    --warning: #FF9500;
    --error: #FF3B30;
    --border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-text {
    color: var(--tg-blue);
}

#ton-connect-button {
    display: flex;
}

/* Main Container */
.container {
    max-width: 420px;
    margin: 0 auto;
    padding: 24px 16px;
    min-height: calc(100vh - 180px);
}

/* Beta Notice */
.beta-notice {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 16px 14px;
    margin-bottom: 16px;
    position: relative;
}

.beta-badge {
    background: var(--tg-blue);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    position: absolute;
    top: -10px;
    left: 12px;
}

.beta-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    text-align: center;
}

.beta-notice strong {
    color: var(--tg-blue);
    font-weight: 500;
}

.beta-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.beta-close:hover {
    opacity: 1;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 6px;
    border-radius: 50px;
    border: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab.active {
    background: var(--tg-blue);
    color: white;
}

.tab:not(.active):hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

/* Pool Selector */
.pool-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 4px;
    border-radius: 50px;
    border: 1px solid var(--border);
}

.pool-pill {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pool-pill.active {
    background: var(--tg-blue);
    color: white;
}

.pool-pill:not(.active):not(.disabled):hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.pool-pill.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Glass Panel */
.panel {
    display: none;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.panel.active {
    display: block;
}

.panel::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(42, 171, 238, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Info Box */
.info-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.info-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.info-value {
    font-weight: 600;
    font-size: 15px;
}

.info-value.contract-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.icon-btn:hover {
    background: rgba(42, 171, 238, 0.2);
    color: var(--tg-blue);
    border-color: var(--tg-blue);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.btn-primary {
    background: var(--tg-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--tg-blue-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Inputs */
input, textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 15px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--tg-blue);
    background: rgba(42, 171, 238, 0.05);
}

input::placeholder, textarea::placeholder {
    color: var(--text-secondary);
}

textarea {
    resize: none;
    height: 90px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

/* Note Display */
.note-display {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 14px;
    margin: 12px 0;
    word-break: break-all;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 11px;
    line-height: 1.6;
    border: 1px solid var(--border);
    color: var(--text);
    user-select: all;
}

/* Warning */
.warning {
    margin: 0 0 12px 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    text-align: center;
}

.deposit-cost {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin: 8px 0;
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Status */
.status {
    text-align: center;
    padding: 10px 0;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 400;
}

.status.loading {
    color: var(--text-secondary);
}

.status.success {
    color: var(--success);
}

.status.error {
    color: var(--error);
}

/* Progress */
.progress {
    margin-top: 20px;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tg-blue), #1a8cd8);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.progress-text {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Connect Prompt */
.connect-prompt {
    text-align: center;
    padding: 16px 20px;
    color: var(--text-secondary);
}

.connect-prompt p {
    margin: 0;
    font-size: 15px;
}

.hidden {
    display: none !important;
}

/* Footer */
footer {
    padding: 24px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 420px;
    margin: 0 auto;
    padding: 0 16px;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
}

.footer-item.link {
    transition: color 0.2s ease;
    cursor: pointer;
}

.footer-item.link:hover {
    color: var(--tg-blue);
}

.footer-logo {
    width: 20px;
    height: 20px;
}

.footer-logo svg {
    width: 100%;
    height: 100%;
}

/* Input hint */
.input-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin: -8px 0 12px 0;
    opacity: 0.8;
    text-align: center;
}

/* Privacy notice */
.privacy-notice {
    background: rgba(42, 171, 238, 0.08);
    border: 1px solid rgba(42, 171, 238, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 8px 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.privacy-notice strong {
    color: var(--tg-blue);
    font-weight: 500;
}
