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

body {
    font-family: 'Noto Sans', sans-serif;
    background: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-family: 'Cal Sans', sans-serif;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.header p {
    font-size: 1.1rem;
    color: #666;
}

.search-section {
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

#walletInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Noto Sans', sans-serif;
    transition: border-color 0.2s ease;
}

#walletInput:focus {
    outline: none;
    border-color: #007bff;
}

#searchBtn {
    padding: 12px 24px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#searchBtn:hover {
    background: #333;
}

#searchBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1a1a1a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #fee;
    color: #c33;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.wallet-info {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr;
}

.info-card, .transactions-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e1e5e9;
}

.info-card h2, .transactions-card h2 {
    font-family: 'Cal Sans', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.info-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item label {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

.info-item span {
    font-size: 1rem;
    color: #1a1a1a;
    word-break: break-all;
}

.usd-balance {
    font-size: 0.85rem;
    color: #666;
    font-weight: normal;
    margin-top: 4px;
}

.xrp-usd-equivalent {
    font-size: 0.85rem;
    color: #007bff;
    font-weight: normal;
    margin-top: 4px;
}

.total-value {
    font-size: 0.9rem;
    color: #28a745;
    font-weight: 600;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e1e5e9;
}

.mono {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem !important;
}

.date-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 12px 0;
    border-bottom: 2px solid #e1e5e9;
    margin: 20px 0 16px 0;
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
}

.date-group-header:first-child {
    margin-top: 0;
}

.date-group-header h3 {
    font-family: 'Cal Sans', sans-serif;
    font-size: 1.2rem;
    color: #1a1a1a;
    margin: 0;
}

.transaction-count {
    font-size: 0.9rem;
    color: #666;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 12px;
}

.date-group-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.transaction-time {
    font-size: 0.9rem;
    color: #666;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

.transactions-list::-webkit-scrollbar {
    width: 6px;
}

.transactions-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.transactions-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.transactions-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.transaction-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e1e5e9;
    transition: transform 0.2s ease;
}

.transaction-item:hover {
    transform: translateY(-1px);
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: boolno;
    gap: 8px;
}

.transaction-type {
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.transaction-type.payment {
    background: #e8f5e8;
    color: #2d5a2d;
}

.transaction-type.trust {
    background: #e8f0ff;
    color: #1e40af;
}

.transaction-type.offer {
    background: #fff3cd;
    color: #856404;
}

.transaction-date {
    font-size: 0.9rem;
    color: #666;
}

.transaction-details {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    margin-top: 16px;
}

.transaction-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 40px;
}

.transaction-detail label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.transaction-detail span {
    font-size: 0.9rem;
    color: #1a1a1a;
    word-break: break-word;
    line-height: 1.4;
}

.info-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.download-btn {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.download-btn:hover {
    background: #0056b3;
}

.address-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-btn {
    padding: 4px 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.copy-btn.copied {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.download-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.name-input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 200px;
}

.name-input:focus {
    outline: none;
    border-color: #007bff;
}

.transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-filter label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.date-input {
    padding: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: 'Noto Sans', sans-serif;
}

.date-input:focus {
    outline: none;
    border-color: #007bff;
}

.filter-btn, .clear-filter-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filter-btn {
    background: #007bff;
    color: white;
}

.filter-btn:hover {
    background: #0056b3;
}

.clear-filter-btn {
    background: #6c757d;
    color: white;
}

.clear-filter-btn:hover {
    background: #545b62;
}

.floating-home-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    padding: 8px 12px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    z-index: 1000;
}

.floating-home-btn:hover {
    background: #333;
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }

    .download-section {
        flex-direction: column;
        align-items: stretch;
    }

    .name-input {
        min-width: auto;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .transaction-details {
        grid-template-columns: 1fr;
    }

    .transactions-header {
        flex-direction: column;
        align-items: stretch;
    }

    .date-filter {
        justify-content: center;
    }
}