body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    display: flex;
}

.sidebar {
    width: 250px;
    height: 100vh;
    background-color: #333;
    color: #fff;
    padding: 20px;
    overflow-y: auto;
    position: fixed;
    left: -270px;
    top: 0;
    bottom: 0;
    transition: left 0.3s ease-in-out;
    z-index: 1000;
    box-sizing: border-box;
}

.sidebar.open {
    left: 0;
}

.main-content {
    flex-grow: 1;
    padding: 20px;
    height: 100vh;
    overflow-y: auto;
    margin-left: 0;
    transition: margin-left 0.3s ease-in-out;
}

.main-content.sidebar-open {
    margin-left: 250px;
}

h1, h2 {
    color: #333;
}

.container {
    max-width: 1200px;
    margin: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

#connectionStatus {
    margin-top: 20px;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
}

.connected {
    background-color: #d4edda;
    color: #155724;
}

.disconnected {
    background-color: #f8d7da;
    color: #721c24;
}

#addressForm, #filterForm {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

input[type="text"], select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.sidebar input[type="text"], .sidebar select {
    width: calc(100% - 20px);
    max-width: 100%;
    box-sizing: border-box;
}

button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

button:hover {
    background-color: #45a049;
}

#addressList ul {
    list-style-type: none;
    padding: 0;
}

#addressList li {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.deleteButton {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
}

.deleteButton:hover {
    background-color: #c82333;
}

.sidebar-toggle {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background-color: #333;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 20px;
    z-index: 1001;
    transition: left 0.3s ease-in-out;
}

.sidebar.open .sidebar-toggle {
    left: 250px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#filterInfo {
    margin-bottom: 10px;
    color: #666;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.notification.show {
    opacity: 1;
}

.notification.success {
    background-color: #4CAF50;
}

.notification.error {
    background-color: #f44336;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.notification.fade-out {
    animation: fadeOut 0.5s ease-in-out forwards;
}

.comment-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 5px 10px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 12px;
    margin: 2px 2px;
    cursor: pointer;
    border-radius: 3px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content.chat-room {
    background-color: #f0f0f0;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    height: 80%;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.chat-header {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px 10px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.chat-header h2 {
    margin: 0;
    font-size: 1.2em;
    text-align: center;
}

.close {
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    left: 15px;
    top: 12px;
    transform: translateY(-50%);
    z-index: 1;
}

.close:hover,
.close:focus {
    color: #f1f1f1;
    text-decoration: none;
}

#commentList.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.comment {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    border-left: 4px solid;
}

.comment-content {
    flex-grow: 1;
    margin-right: 10px;
    word-break: break-word;
}

.comment-info {
    display: flex;
    align-items: center;
    font-size: 0.8em;
    color: #888;
    white-space: nowrap;
}

.comment .user-id {
    font-weight: bold;
    color: #4CAF50;
    margin-right: 10px;
}

.comment .timestamp {
    margin-right: 10px;
}

.comment .delete-button {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 2px 5px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
}

#commentForm.chat-input {
    display: flex;
    padding: 10px;
    background-color: white;
    border-top: 1px solid #ddd;
}

#commentInput {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px;
    margin-right: 10px;
    resize: none;
}

#submitComment {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    border-radius: 20px;
}

#submitComment:hover {
    background-color: #45a049;
}

#submitComment:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.cooldown-timer {
    margin-left: 10px;
    font-size: 14px;
    color: #666;
    align-self: center;
}

#transactionTable {
    width: 100%;
    table-layout: fixed;
    overflow-x: auto;
}

#transactionTable th,
#transactionTable td {
    padding: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.address-col {
    width: 60px;
    min-width: 60px;
}

.address-cell {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.address-link {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 5px;
    text-decoration: none;
    color: #2ecc71;
}

.favorite-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    color: #ccc;
    transition: color 0.3s ease;
    padding: 0;
    margin-right: 5px;
    display: flex;
    align-items: center;
}

.favorite-button.active {
    color: #ffd700;
}

.favorite-button:hover {
    color: #ffd700;
}

.favorite-count {
    font-size: 0.8em;
    color: #666;
    margin-right: 12px;
}

.type-col {
    width: 5%;
}

.transaction-info-col {
    width: 60%;
}

.comments-col {
    width: 15%;
}

@media screen and (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        left: -100%;
    }
    .sidebar.open {
        left: 0;
    }
    .sidebar.open .sidebar-toggle {
        left: calc(100% - 40px);
    }
    .main-content.sidebar-open {
        margin-left: 0;
    }
    table {
        font-size: 14px;
    }
    th, td {
        padding: 8px;
    }
    #transactionTable {
        font-size: 14px;
    }
    .address-col {
        width: 80px;
        min-width: 80px;
    }
}

@media screen and (max-width: 600px) {
    .modal-content.chat-room {
        width: 95%;
        height: 90%;
        margin: 5% auto;
    }

    .chat-header h2 {
        font-size: 1em;
    }

    .close {
        font-size: 18px;
        left: 2px;
    }

    #commentInput {
        font-size: 14px;
    }

    #submitComment {
        font-size: 14px;
        padding: 8px 16px;
    }

    #transactionTable {
        font-size: 12px;
    }

    .address-col {
        width: 50px;
        min-width: 50px;
    }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.pagination-button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 5px;
}

.pagination-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#pageInfo {
    margin: 0 20px;
    font-size: 16px;
}

.audio-button {
    margin-bottom: 20px;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.audio-button:hover {
    background-color: #2980b9;
}

.audio-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.transaction-link {
    color: #2ecc71;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.transaction-link:hover {
    color: #27ae60;
    text-decoration: underline;
}

.transaction-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.transaction-date {
    color: #7f8c8d;
    font-size: 0.9em;
}