:root {
    --primary: #14f195;
    --primary-dark: #0fc17a;
    --secondary: #9945ff;
    --background: #0d1117;
    --surface: #161b22;
    --surface-hover: #1c2128;
    --text-primary: #f0f6fc;
    --text-secondary: #7d8590;
    --border: #30363d;
    --success: #238636;
    --warning: #f85149;
    --error: #da3633;
    --gradient-primary: linear-gradient(135deg, #14f195, #9945ff);
    --gradient-card: linear-gradient(135deg, rgba(20, 241, 149, 0.1), rgba(153, 69, 255, 0.1));
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Modern glassmorphism background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(20, 241, 149, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(153, 69, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(20, 241, 149, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundFloat 20s ease-in-out infinite alternate;
}

@keyframes backgroundFloat {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(1deg); }
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo1 {
    font-size: 1.8rem;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(20, 241, 149, 0.5));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.wallet-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--background);
    box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.btn-connected {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

/* Connection Status Indicators */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.connected {
    background-color: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.status-indicator.disconnected {
    background-color: var(--error);
}

.status-indicator.connecting {
    background-color: var(--warning);
    animation: pulse 1s infinite;
}

.connection-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.connection-badge.connected {
    background: rgba(35, 134, 54, 0.2);
    color: #7ee787;
    border: 1px solid rgba(35, 134, 54, 0.3);
}

.wallet-info {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    backdrop-filter: blur(10px);
    min-width: 300px;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 200;
}

.wallet-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wallet-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.wallet-address {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--background);
    padding: 0.5rem;
    border-radius: 6px;
    word-break: break-all;
    border: 1px solid var(--border);
    max-width: 200px;
}

.balance-display {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--primary);
}

/* Debug Panel */
.debug-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.debug-header {
    padding: 1rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.debug-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.debug-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

.debug-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.debug-content {
    padding: 1rem;
}

.debug-status {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.debug-status span:first-child {
    color: var(--text-secondary);
}

.status-unknown {
    color: var(--warning);
}

.status-success {
    color: var(--success);
}

.status-error {
    color: var(--error);
}

.debug-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.debug-log {
    background: var(--background);
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-line;
    line-height: 1.4;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Card Layout */
.launch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

.card {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.card:hover::before {
    opacity: 1;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 241, 149, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Features Grid */
.features {
    margin-top: 6rem;
}

.features h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Status and Progress */
.status-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.5s ease;
}

.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(35, 134, 54, 0.1);
    border-left-color: var(--success);
    color: #7ee787;
}

.alert-error {
    background: rgba(248, 81, 73, 0.1);
    border-left-color: var(--warning);
    color: #ffa198;
}

.alert-info {
    background: rgba(20, 241, 149, 0.1);
    border-left-color: var(--primary);
    color: var(--primary);
}

/* Loading States */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-hover);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

/* Advanced form elements */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-group:hover {
    border-color: var(--primary);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.fee-breakdown {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
}

.fee-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.fee-item:last-child {
    margin-bottom: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-weight: 600;
}

/* Alert Container */
#alertContainer {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1001;
    max-width: 400px;
    pointer-events: none;
}

#alertContainer .alert {
    pointer-events: auto;
    margin-bottom: 0.5rem;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 2rem;
    }

    .launch-grid {
        grid-template-columns: 1fr;
    }

    .header-container {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .wallet-section {
        width: 100%;
        justify-content: center;
    }

    .wallet-info {
        position: relative;
        top: auto;
        right: auto;
        min-width: auto;
        width: 100%;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .debug-panel {
        margin: 1rem;
    }
}

/* Wallet Info Card - replaces modal display */
.wallet-info-card {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.wallet-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.wallet-info-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.wallet-info-content .wallet-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wallet-info-content .wallet-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.wallet-info-content .wallet-address {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--surface);
    padding: 0.5rem;
    border-radius: 6px;
    word-break: break-all;
    border: 1px solid var(--border);
    max-width: 300px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wallet-info-content .wallet-address:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Update button styles for disconnect state */
.btn-disconnect {
    background: var(--error);
    color: white;
    border: 1px solid var(--error);
}

.btn-disconnect:hover:not(:disabled) {
    background: #b91c1c;
    transform: translateY(-2px);
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
        flex-direction: row; /* Keep horizontal on mobile */
        justify-content: space-between;
        align-items: center;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .wallet-section {
        flex-shrink: 0;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .wallet-info-card {
        margin: 1rem;
        padding: 1rem;
    }
    
    .wallet-info-content .wallet-address {
        max-width: 200px;
        font-size: 0.75rem;
    }
    
    .wallet-row {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    
    .wallet-row span:first-child {
        font-weight: 600;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0.75rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .connection-status {
        display: none; /* Hide status indicator on very small screens */
    }
}