body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #2c1e4c 0%, #532c76 50%, #433496 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(107, 70, 193, 0.25), 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

h1 {
    text-align: center;
    color: #6B46C1;
    margin-bottom: 40px;
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #6B46C1 0%, #9333EA 50%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(107, 70, 193, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #6B46C1;
    font-size: 15px;
    letter-spacing: 0.3px;
}

textarea {
    width: 100%;
    padding: 18px;
    border: 2px solid #E5E7EB;
    border-radius: 16px;
    font-size: 15px;
    resize: vertical;
    box-sizing: border-box;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    background: #FAFBFC;
    transition: all 0.3s ease;
    line-height: 1.6;
    min-height: 120px;
    text-align: right;
    direction: rtl;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
}

textarea:focus {
    border-color: #9333EA;
    outline: none;
    box-shadow: 0 0 0 4px rgba(147, 51, 234, 0.15);
    background: white;
    transform: translateY(-2px);
}

button {
    background: linear-gradient(135deg, #6B46C1 0%, #9333EA 100%);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    margin-top: 15px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(107, 70, 193, 0.3);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(107, 70, 193, 0.4);
    background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
}

button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.result {
    margin-top: 5px;
    padding: 4px;
    border-radius: 16px;
    display: none;
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
}

.success {
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    color: #166534;
    border-color: #22C55E;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.15);
}

.error {
    background: linear-gradient(135deg, #FEF2F2 0%, #FECACA 100%);
    color: #991B1B;
    border-color: #EF4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15);
}

.info {
    background: linear-gradient(135deg, #F0F9FF 0%, #DBEAFE 100%);
    color: #1E40AF;
    border-color: #3B82F6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

.loading {
    text-align: center;
    color: #6B46C1;
    background: linear-gradient(135deg, #FAF5FF 0%, #E9D5FF 100%);
    border-color: #A855F7;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.15);
}

.wallet-info {
    background: linear-gradient(135deg, #FAFBFC 0%, #F1F5F9 100%);
    padding: 30px;
    border-radius: 20px;
    margin-top: 20px;
    border: 1px solid rgba(107, 70, 193, 0.1);
    box-shadow: 0 8px 25px rgba(107, 70, 193, 0.1);
}

.balance-item {
    padding: 18px;
    margin: 12px 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    border-left: 5px solid #6B46C1;
    box-shadow: 0 4px 15px rgba(107, 70, 193, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.balance-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 70, 193, 0.2);
}

.balance-item.claimable {
    border-left-color: #F59E0B;
    background: rgba(255, 251, 235, 0.9);
}

.balance-item small {
    font-size: 12px;
    color: #666;
    display: block;
    margin-top: 5px;
}

.balance-item .status-available {
    color: #4caf50 !important;
    font-weight: bold;
}

.balance-item .status-pending {
    color: #ff5722 !important;
}

.balance-item .status-expired {
    color: #f44336 !important;
}

.balance-item .time-info {
    font-style: italic;
    margin-top: 3px;
}

.section {
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.7);
    padding: 35px;
    border-radius: 20px;
    border: 1px solid rgba(107, 70, 193, 0.15);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(107, 70, 193, 0.1);
}

.section h3 {
    color: #6B46C1;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #E5E7EB;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

input[type="text"], input[type="number"] {
    width: 100%;
    padding: 16px;
    border: 2px solid #E5E7EB;
    border-radius: 16px;
    font-size: 15px;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    background: #FAFBFC;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
    border-color: #9333EA;
    outline: none;
    box-shadow: 0 0 0 4px rgba(147, 51, 234, 0.15);
    background: white;
    transform: translateY(-2px);
}

hr {
    border: none;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(107, 70, 193, 0.3), transparent);
    margin: 50px 0;
    border-radius: 2px;
}

/* Transfer section styles */
#sendPi {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

#sendPi:hover {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.4);
}

#sendPi:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.transfer-status {
    margin-top: 20px;
    padding: 16px;
    border-radius: 16px;
    font-size: 15px;
    display: none;
    backdrop-filter: blur(10px);
    border: 1px solid transparent;
}

.transfer-status.success {
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    color: #166534;
    border-color: #22C55E;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.15);
}

.transfer-status.error {
    background: linear-gradient(135deg, #FEF2F2 0%, #FECACA 100%);
    color: #991B1B;
    border-color: #EF4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15);
}

.transfer-status.loading {
    background: linear-gradient(135deg, #F0F9FF 0%, #DBEAFE 100%);
    color: #1E40AF;
    border-color: #3B82F6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

.transfer-status.warning {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    color: #92400E;
    border-color: #F59E0B;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

.transaction-hash {
    word-break: break-all;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 13px;
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    padding: 12px;
    border-radius: 12px;
    margin-top: 8px;
    border: 1px solid rgba(107, 70, 193, 0.2);
    max-width: 100%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(107, 70, 193, 0.1);
}

/* Additional seed phrase textarea styling */
textarea.seed-phrase {
    text-align: right;
    direction: rtl;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    font-weight: 500;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #FAFBFC 0%, #F8FAFC 100%);
    border: 2px solid #E5E7EB;
    color: #374151;
}

textarea.seed-phrase:focus {
    background: linear-gradient(135deg, #FFFFFF 0%, #FAFBFC 100%);
    color: #111827;
}

textarea.seed-phrase::placeholder {
    text-align: right;
    direction: rtl;
    color: #9CA3AF;
    font-style: italic;
}

/* Pi Network inspired gradients and shadows */
.pi-gradient {
    background: linear-gradient(135deg, #6B46C1 0%, #9333EA 50%, #7C3AED 100%);
}

.pi-shadow {
    box-shadow: 
        0 4px 15px rgba(107, 70, 193, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

.pi-shadow-hover:hover {
    box-shadow: 
        0 8px 25px rgba(107, 70, 193, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Enhanced button animations */
button {
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

button:hover::before {
    left: 100%;
}

/* Loading animation for status messages */
.transfer-status.loading::after {
    content: '';
    display: inline-block;
    margin-left: 8px;
    width: 16px;
    height: 16px;
    border: 2px solid #3B82F6;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Enhanced focus states */
input:focus,
textarea:focus {
    border-color: #9333EA;
    outline: none;
    box-shadow: 
        0 0 0 4px rgba(147, 51, 234, 0.15),
        0 4px 15px rgba(147, 51, 234, 0.1);
    transform: translateY(-2px);
}

/* Status icons */
.status-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

.status-icon.success::before {
    content: '✓';
    color: #22C55E;
    font-weight: bold;
    font-size: 16px;
}

.status-icon.error::before {
    content: '✗';
    color: #EF4444;
    font-weight: bold;
    font-size: 16px;
}

.status-icon.warning::before {
    content: '⚠';
    color: #F59E0B;
    font-weight: bold;
    font-size: 16px;
}

.status-icon.info::before {
    content: 'ℹ';
    color: #3B82F6;
    font-weight: bold;
    font-size: 16px;
}

/* Mobile-specific textarea improvements */
@media (max-width: 768px) {
    body {
        padding: 15px;
        font-size: 14px;
    }
    
    .container {
        padding: 25px;
    }
    
    .section {
        padding: 20px;
        margin-bottom: 25px;
    }
    
    .section h3 {
        font-size: 18px;
    }
    
    .wallet-info {
        padding: 20px;
    }
    
    h1 {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    label {
        font-size: 14px;
    }
    
    input[type="text"], input[type="number"] {
        font-size: 14px;
        padding: 12px;
    }
    
    textarea {
        font-size: 14px;
        padding: 14px;
    }
    
    textarea.seed-phrase {
        font-size: 13px;
        padding: 12px;
        min-height: 100px;
        line-height: 1.5;
    }
    
    textarea.seed-phrase::placeholder {
        font-size: 12px;
    }
    
    button {
        font-size: 14px;
        padding: 12px 24px;
    }
    
    .balance-item {
        padding: 14px;
        font-size: 14px;
    }
    
    .balance-item small {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
        font-size: 13px;
    }
    
    .container {
        padding: 20px;
    }
    
    .section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .section h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .wallet-info {
        padding: 15px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    label {
        font-size: 13px;
    }
    
    input[type="text"], input[type="number"] {
        font-size: 13px;
        padding: 10px;
    }
    
    textarea {
        font-size: 13px;
        padding: 12px;
    }
    
    textarea.seed-phrase {
        font-size: 12px;
        padding: 10px;
        min-height: 90px;
        border-radius: 12px;
    }
    
    textarea.seed-phrase::placeholder {
        font-size: 11px;
    }
    
    button {
        font-size: 13px;
        padding: 10px 20px;
    }
    
    .balance-item {
        padding: 12px;
        font-size: 13px;
        margin: 8px 0;
    }
    
    .balance-item small {
        font-size: 10px;
    }
    
    .result {
        padding: 8px;
        font-size: 13px;
    }
    
    .transfer-status {
        padding: 12px;
        font-size: 13px;
    }
}

@media (max-width: 375px) {
    body {
        padding: 8px;
        font-size: 12px;
    }
    
    .container {
        padding: 15px;
    }
    
    .section {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .section h3 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .wallet-info {
        padding: 12px;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    label {
        font-size: 12px;
    }
    
    input[type="text"], input[type="number"] {
        font-size: 12px;
        padding: 8px;
    }
    
    textarea {
        font-size: 12px;
        padding: 10px;
    }
    
    textarea.seed-phrase {
        font-size: 11px;
        padding: 8px;
        min-height: 80px;
        border-radius: 10px;
    }
    
    textarea.seed-phrase::placeholder {
        font-size: 10px;
    }
    
    button {
        font-size: 12px;
        padding: 8px 16px;
    }
    
    .balance-item {
        padding: 10px;
        font-size: 12px;
        margin: 6px 0;
    }
    
    .balance-item small {
        font-size: 9px;
    }
    
    .result {
        padding: 6px;
        font-size: 12px;
    }
    
    .transfer-status {
        padding: 10px;
        font-size: 12px;
    }
    
    .transaction-hash {
        font-size: 10px;
        padding: 8px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Keep light theme as Pi Network uses light theme */
}

/* Quick sweep button styling */
.form-group {
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.form-group::after {
    content: "";
    display: table;
    clear: both;
}

.quick-sweep {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    width: auto;
    margin-top: 8px;
    margin-bottom: 0;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
    display: block;
    float: right;
}

.quick-sweep:hover {
    background: linear-gradient(135deg, #B91C1C 0%, #991B1B 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.quick-sweep:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive adjustments for quick sweep button */
@media (max-width: 768px) {
    .quick-sweep {
        font-size: 11px;
        padding: 6px 12px;
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .quick-sweep {
        font-size: 10px;
        padding: 5px 10px;
        border-radius: 6px;
        float: none;
        display: block;
        width: 100%;
        margin-top: 10px;
    }
}

@media (max-width: 375px) {
    .quick-sweep {
        font-size: 9px;
        padding: 4px 8px;
        border-radius: 5px;
    }
}

/* Mobile responsive styles for IDs and keys */
.public-key-display, .id-display {
    word-break: break-all;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 13px;
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(107, 70, 193, 0.2);
    margin-top: 4px;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(107, 70, 193, 0.1);
}

.id-display.small {
    font-size: 10px;
    padding: 4px 6px;
    border-radius: 5px;
    background: linear-gradient(135deg, #FAFBFC 0%, #F8FAFC 100%);
}

.info-row {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    font-weight: 600;
    color: #6B46C1;
    font-size: 14px;
}

.info-value {
    font-size: 14px;
    color: #374151;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    .public-key-display, .id-display {
        font-size: 11px;
        padding: 4px 6px;
        line-height: 1.2;
    }
    
    .id-display.small {
        font-size: 9px;
        padding: 3px 4px;
    }
    
    .info-label {
        font-size: 13px;
    }
    
    .info-value {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .public-key-display, .id-display {
        font-size: 10px;
        padding: 3px 5px;
        border-radius: 4px;
        line-height: 1.1;
    }
    
    .id-display.small {
        font-size: 8px;
        padding: 2px 3px;
    }
    
    .info-row {
        margin-bottom: 10px;
    }
    
    .info-label {
        font-size: 12px;
    }
    
    .info-value {
        font-size: 12px;
    }
}

@media (max-width: 375px) {
    .public-key-display, .id-display {
        font-size: 9px;
        padding: 2px 4px;
        border-radius: 3px;
        line-height: 1.0;
    }
    
    .id-display.small {
        font-size: 7px;
        padding: 1px 2px;
    }
    
    .info-label {
        font-size: 11px;
    }
    
    .info-value {
        font-size: 11px;
    }
}
