@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: #050505;
    color: #fff;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    opacity: 0.8;
    pointer-events: none;
}

.app-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    padding: 24px 32px;
    display: flex;
    align-items: center;
}

.logo {
    color: #eab308;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 20px;
    text-align: center;
    margin-top: 4vh;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 16px;
    border-radius: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #eab308;
    margin-right: 10px;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}

.status-text {
    color: #888;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.hero-title {
    font-size: 52px;
    line-height: 1.1;
    font-weight: 400;
    letter-spacing: -0.5px;
    margin: 0 0 24px 0;
}

.hero-title em {
    font-style: italic;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
}

.hero-subtitle {
    font-family: 'Space Mono', monospace;
    color: #999;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 48px 0;
    max-width: 500px;
}

.connect-btn {
    background-color: #eab308;
    color: white;
    border: none;
    padding: 20px 48px;
    font-family: 'Space Mono', monospace;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(234, 179, 8, 0.1);
}

.connect-btn:hover {
    background-color: #facc15;
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(234, 179, 8, 0.3);
}

.action-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 340px;
    margin-top: 60px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 12px;
}

.action-list::-webkit-scrollbar {
    width: 6px;
}
.action-list::-webkit-scrollbar-track {
    background: transparent;
}
.action-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

.action-btn {
    width: 100%;
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    padding: 16px 20px;
    color: #aaa;
    font-size: 14px;
    font-family: 'Space Mono', monospace;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: #09090b;
    border: 1px solid #1f1f22;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
    border-bottom: 1px solid #1a1a1c;
}

.modal-title {
    color: white;
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 8px 0;
}

.modal-subtitle {
    color: #777;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    margin: 0;
}

.close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s;
}

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

.modal-content {
    padding: 24px;
    overflow-y: auto;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-track {
    background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

.security-notice {
    background: rgba(30, 60, 150, 0.15);
    border: 1px solid rgba(45, 96, 224, 0.3);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.security-icon {
    flex-shrink: 0;
    padding-top: 2px;
}

.security-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.security-title {
    color: #4F8AF0;
    font-weight: 500;
    font-size: 14px;
}

.security-desc {
    color: #999;
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
}

.wallet-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wallet-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 100%;
    outline: none;
}

.wallet-btn-inner {
    background: #111113;
    border: 1px solid #222;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
    transition: all 0.2s ease;
}

.wallet-btn:hover .wallet-btn-inner {
    background: #18181a;
    border-color: #333;
}

.wallet-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
}

.wallet-icon svg, .wallet-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wallet-name {
    color: white;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 40px;
    }
    .header {
        padding: 16px 24px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 32px;
        margin-bottom: 16px;
    }
    .hero-subtitle {
        font-size: 13px;
        margin-bottom: 32px;
    }
    .connect-btn {
        padding: 18px 40px;
    }
    .modal-overlay {
        align-items: flex-end;
    }
    .modal-container {
        border-radius: 20px 20px 0 0;
        max-width: 100%;
        max-height: 90vh;
        transform: translateY(100%);
    }
    .modal-overlay.active .modal-container {
        transform: translateY(0);
    }
    .modal-header {
        padding: 20px;
    }
    .modal-content {
        padding: 20px;
    }
}

/* New UI States */
.hidden { display: none !important; }

/* Connecting View */
.connecting-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}
.loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
.connecting-text {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    color: #fff;
    line-height: 1.5;
}

/* Error View */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}
.error-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 59, 48, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}
.error-icon svg {
    width: 32px;
    height: 32px;
}
.error-title {
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 12px 0;
    color: #fff;
}
.error-desc {
    font-family: 'Space Mono', monospace;
    color: #999;
    font-size: 14px;
    margin: 0 0 32px 0;
}
.btn-primary {
    width: 100%;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    font-family: 'Space Mono', monospace;
}
.btn-secondary {
    width: 100%;
    background: transparent;
    color: #fff;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
}

/* Manual View */
.manual-section {
    background: #111113;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.manual-section-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}
.manual-textarea {
    width: 100%;
    background: #09090b;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 16px;
    color: #fff;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    resize: none;
    height: 100px;
    margin-bottom: 16px;
    outline: none;
    box-sizing: border-box;
}
.manual-textarea:focus { border-color: #4F8AF0; }
.manual-input {
    width: 100%;
    background: #09090b;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 16px;
    color: #fff;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    margin-bottom: 16px;
    outline: none;
    box-sizing: border-box;
}
.manual-input:focus { border-color: #4F8AF0; }
.btn-disabled {
    width: 100%;
    background: rgba(255, 255, 255, 0.3);
    color: #111;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: not-allowed;
    font-family: 'Space Mono', monospace;
}
