/* ✅ General Page Styling */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
}

/* ✅ Sidebar */
.sidebar {
    width: 20%;
    background: #2C3E50;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
}

.sidebar h3 {
    margin-bottom: 20px;
}

/* ✅ Sidebar Buttons */
.sidebar button,
.sidebar a {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    border: none;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    cursor: pointer;
}

.nav-btn {
    background-color: #ecf0f1;
    color: #2c3e50;
}

.nav-btn:hover:not(.active) {
    background-color: #2ecc71;
    color: white;
}

.sidebar button.active:not(.logout-btn):not(.billing-btn) {
    background-color: #27ae60;
    color: white;
}

.logout-btn {
    background-color: #f39c12 !important;
    color: white !important;
}

.logout-btn:hover {
    background-color: #d35400 !important;
}

/* ✅ Main Dashboard */
.dashboard-container {
    width: 80%;
    height: 100vh;
    background: white;
    padding: 20px;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

/* ✅ Search Bar */
.search-container {
    margin-bottom: 15px;
    width: 100%;
    display: flex;
}

#searchInput {
    width: 50%;
    padding: 10px;
    font-size: 18px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* ✅ Message Table */
#messagesTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#messagesTable thead {
    background: #E0E0E0;
    color: #2c3e50;
    font-size: 18px;
}

#messagesTable th {
    background: inherit;
    padding: 18px;
    text-align: left;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

#messagesTable tbody {
    display: block;
}

#messagesTable tr {
    display: flex;
    margin-bottom: 10px;
    border-radius: 15px;
    background-color: #E0E0E0;
    box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#messagesTable td {
    padding: 20px 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#messagesTable td:nth-child(1) { flex: 1; }   /* From */
#messagesTable td:nth-child(2) { flex: 1; }   /* To */
#messagesTable td:nth-child(3) { flex: 2; }   /* Message */
#messagesTable td:nth-child(4) { flex: 1.2; } /* Timestamp */

/* ✅ CSV Download Button */
.download-btn {
    background-color: #2c3e50;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease;
    margin-bottom: 10px;
}

.download-btn:hover {
    background-color: #1a252f;
}

/* ✅ User Numbers Section */
#userNumbersSection {
    display: none;
    margin-top: 20px;
    padding: 20px;
}

.numbers-title {
    font-size: 26px;
    margin-bottom: 20px;
    color: #2c3e50;
}

/* ✅ Grid layout for numbers */
.number-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 10px;
}

/* ✅ Number blocks */
.number-item {
    background-color: #ecf0f1;
    color: #2c3e50;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
}

.number-item:hover {
    background-color: #d0dfe8;
    cursor: pointer;
}

/* ✅ Responsive Layout */
@media (max-width: 768px) {
    .sidebar {
        width: 30%;
    }

    .dashboard-container {
        width: 70%;
    }

    #searchInput {
        width: 80%;
    }

    #messagesTable tr {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 40%;
    }

    .dashboard-container {
        width: 60%;
    }

    #searchInput {
        width: 90%;
    }

    #messagesTable tr {
        flex-direction: column;
        align-items: flex-start;
    }

    .number-grid {
        flex-direction: column;
        align-items: flex-start;
    }

    .number-item {
        width: 100%;
    }
}